summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am4
-rw-r--r--pages/index.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 3bc28cb..8bfd9ed 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = index.js
index_js_SOURCES = pages/index.c
-index_js_LDFLAGS = -s EXTRA_EXPORTED_RUNTIME_METHODS=[cwrap] \
- -s EXPORTED_FUNCTIONS=[_index_getproducts] \
+index_js_LDFLAGS = -s EXPORTED_RUNTIME_METHODS=[cwrap] \
+ -s EXPORTED_FUNCTIONS=[_main,_index_getproducts] \
-s FETCH
diff --git a/pages/index.c b/pages/index.c
index 91d8471..fc165b6 100644
--- a/pages/index.c
+++ b/pages/index.c
@@ -33,3 +33,9 @@ void index_getproducts(const char *token, const char *app_url)
sprintf(url, "%s%s", app_url, path);
emscripten_fetch(&attr, url);
}
+
+int main(int argc, char *argv[])
+{
+ EM_ASM(getToken());
+ return 0;
+}