Add JS support to Mongoose

PUBLISHED_FROM=5f319c5c6d965432da063ce7ab495ae24e972755
This commit is contained in:
Sergey Lyubka committed 2015-09-22 10:32:01 +01:00
1 parent 51e016089e
commit f014918435
4 files changed
+129 -20

No files matched your search

+5
View File
@@ -8,6 +8,11 @@ else ifeq ($(SSL), krypton)
CFLAGS += -DMG_ENABLE_SSL ../../../krypton/krypton.c
endif
ifeq ($(JS), yes)
V7_PATH = ../../../v7
CFLAGS_EXTRA += -DMG_ENABLE_JAVASCRIPT -I $(V7_PATH) $(V7_PATH)/v7.c
endif
all: $(PROG)
$(PROG): $(SOURCES)
+8
View File
@@ -67,6 +67,11 @@ int main(int argc, char *argv[]) {
s_http_port = argv[++i];
} else if (strcmp(argv[i], "-a") == 0 && i + 1 < argc) {
s_http_server_opts.auth_domain = argv[++i];
#ifdef MG_ENABLE_JAVASCRIPT
} else if (strcmp(argv[i], "-j") == 0 && i + 1 < argc) {
const char *init_file = argv[++i];
mg_enable_javascript(&mgr, v7_create(), init_file);
#endif
} else if (strcmp(argv[i], "-P") == 0 && i + 1 < argc) {
s_http_server_opts.global_auth_file = argv[++i];
} else if (strcmp(argv[i], "-p") == 0 && i + 1 < argc) {
@@ -81,6 +86,9 @@ int main(int argc, char *argv[]) {
} else if (strcmp(argv[i], "-s") == 0 && i + 1 < argc) {
ssl_cert = argv[++i];
#endif
} else {
fprintf(stderr, "Unknown option: [%s]\n", argv[i]);
exit(1);
}
}