From c093d40d4e0c34f82ad950256fe3af978dd92b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Wed, 14 Sep 2022 21:05:35 +0800 Subject: Set the toml & html file paths here now --- web/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'web') 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; -- cgit v1.2.3