mirror of https://git.kore.io/kore.git
fix so we can properly add binary media
This commit is contained in:
parent
f48fe0a326
commit
d2c4fde7fe
|
@ -10,7 +10,7 @@ MODULE=example.module
|
||||||
|
|
||||||
# The directory containing all your media files (HTML, CSS, ...).
|
# The directory containing all your media files (HTML, CSS, ...).
|
||||||
# These files will be compiled into the module and symbols will
|
# These files will be compiled into the module and symbols will
|
||||||
# be exported for you to use in your code (see static.h after building).
|
# be exported for you to use in your code.
|
||||||
MEDIA_DIR=media
|
MEDIA_DIR=media
|
||||||
|
|
||||||
# The directory containing your module source.
|
# The directory containing your module source.
|
||||||
|
@ -69,3 +69,4 @@ echo "Building completed!"
|
||||||
rm -rf ${SOURCE_DIR}/${MEDIA_DIR}
|
rm -rf ${SOURCE_DIR}/${MEDIA_DIR}
|
||||||
rm -rf .objs
|
rm -rf .objs
|
||||||
rm -f tools/inject
|
rm -f tools/inject
|
||||||
|
rm -f static.h
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 818 KiB |
|
@ -20,7 +20,7 @@ workers 2
|
||||||
#onload myinit
|
#onload myinit
|
||||||
|
|
||||||
# Specifies what module to be loaded.
|
# Specifies what module to be loaded.
|
||||||
load ./example.module
|
load modules/example/example.module
|
||||||
|
|
||||||
# Domain configuration
|
# Domain configuration
|
||||||
#
|
#
|
||||||
|
@ -46,6 +46,7 @@ domain 10.211.55.3 {
|
||||||
accesslog /var/log/kore_access.log
|
accesslog /var/log/kore_access.log
|
||||||
static /css/style.css serve_style_css
|
static /css/style.css serve_style_css
|
||||||
static / serve_index
|
static / serve_index
|
||||||
|
static /intro.jpg serve_intro
|
||||||
}
|
}
|
||||||
|
|
||||||
#domain domain.com {
|
#domain domain.com {
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
|
|
||||||
int serve_style_css(struct http_request *);
|
int serve_style_css(struct http_request *);
|
||||||
int serve_index(struct http_request *);
|
int serve_index(struct http_request *);
|
||||||
|
int serve_intro(struct http_request *);
|
||||||
|
|
||||||
int
|
int
|
||||||
serve_style_css(struct http_request *req)
|
serve_style_css(struct http_request *req)
|
||||||
|
@ -84,3 +85,15 @@ serve_index(struct http_request *req)
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
serve_intro(struct http_request *req)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
http_response_header_add(req, "content-type", "image/jpg");
|
||||||
|
ret = http_response(req, 200, static_jpg_intro,
|
||||||
|
static_len_jpg_intro);
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
|
@ -32,7 +32,8 @@ main(int argc, char *argv[])
|
||||||
struct stat st;
|
struct stat st;
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
FILE *hdr;
|
FILE *hdr;
|
||||||
char *ext, c[1];
|
char *ext;
|
||||||
|
unsigned char c[1];
|
||||||
int fd, newline, count;
|
int fd, newline, count;
|
||||||
|
|
||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
|
|
Loading…
Reference in New Issue