summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-19 07:43:09 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-19 07:43:09 +0800
commit057f7ac151496b3b532fbe6e0824ce287d84054e (patch)
tree535c8872aae62b6063ed4f66ad9387a4f4c77287 /main.c
parent603d4f0f85cac6942996c2c1f74672bd2c562e27 (diff)
Move everything up, no more web dir
Diffstat (limited to 'main.c')
-rw-r--r--main.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..240d9bd
--- /dev/null
+++ b/main.c
@@ -0,0 +1,32 @@
+#include <string.h>
+#include <stdio.h>
+#include <shopify.h>
+
+int main(int argc, char *argv[])
+{
+ const size_t app_dir_len = strlen(APP_DIR);
+ static const char *scope_rel = "/shopify.app.toml";
+ char scope[app_dir_len + strlen(scope_rel) + 1];
+ sprintf(scope, "%s%s", APP_DIR, scope_rel);
+ static const char *index_rel = "/frontend/index.html";
+ char index[app_dir_len + strlen(index_rel) + 1];
+ sprintf(index, "%s%s", APP_DIR, index_rel);
+ shopify_app(API_KEY, API_SECRET_KEY, APP_URL, "/auth", APP_ID, scope,
+ index, (struct shopify_api[]){
+ {
+ "/products",
+ "GET",
+ shopify_graphql,
+ "{"\
+ " productCreate() {"\
+ " product {"\
+ " id"\
+ " }"\
+ " }"\
+ "}"
+ },
+ {}
+ }
+ );
+ return 0;
+}