summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-14 21:05:35 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-14 21:05:35 +0800
commitc093d40d4e0c34f82ad950256fe3af978dd92b02 (patch)
treeb70da02d88df5e56996541a14b2b29ccf00dafe5 /web
parent27bea41723248232a13d00d9ec340c6ea6603e70 (diff)
Set the toml & html file paths here now
Diffstat (limited to 'web')
-rw-r--r--web/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/web/main.c b/web/main.c
index f8d0b82..9ec7463 100644
--- a/web/main.c
+++ b/web/main.c
@@ -21,9 +21,17 @@ static enum MHD_Result handle_request(void *cls, struct MHD_Connection *conn,
free(params);
return MHD_NO;
}
+ const size_t dir_len = strlen(APP_DIR);
+ static const char *toml_rel_path = "/shopify.app.toml";
+ char toml_abs_path[dir_len + strlen(toml_rel_path) + 1];
+ sprintf(toml_abs_path, "%s%s", APP_DIR, toml_rel_path);
+ static const char *html_rel_path = "/web/frontend/index.html";
+ char html_abs_path[dir_len + strlen(html_rel_path) + 1];
+ sprintf(html_abs_path, "%s%s", APP_DIR, html_rel_path);
struct MHD_Response *resp;
enum MHD_Result ret = shopify_respond(params, url, redir_url, APP_URL,
- APP_ID, API_KEY, API_SECRET_KEY, APP_DIR, conn, &resp);
+ APP_ID, API_KEY, API_SECRET_KEY, toml_abs_path,
+ html_abs_path, conn, &resp);
MHD_destroy_response(resp);
free(params);
return ret;