From 7de33078f3e08e8076650af783c049e0a9912527 Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Wed, 7 Feb 2024 13:58:14 -0500 Subject: [PATCH] (core) Support GRIST_INCLUDE_CUSTOM_SCRIPT_URL for custom scripts, specifically for rapid prototyping support Test Plan: Tested manually on localhost Reviewers: paulfitz, georgegevoian Reviewed By: paulfitz, georgegevoian Subscribers: paulfitz, georgegevoian Differential Revision: https://phab.getgrist.com/D4186 --- app/server/lib/sendAppPage.ts | 7 +++++++ static/app.html | 1 + static/error.html | 1 + 3 files changed, 9 insertions(+) diff --git a/app/server/lib/sendAppPage.ts b/app/server/lib/sendAppPage.ts index 991b39fb..f1a8bc10 100644 --- a/app/server/lib/sendAppPage.ts +++ b/app/server/lib/sendAppPage.ts @@ -116,6 +116,12 @@ export function makeSendAppPage(opts: { baseDomain?: string }) { const {server, staticDir, tag, testLogin} = opts; + + // If env var GRIST_INCLUDE_CUSTOM_SCRIPT_URL is set, load it in a ` : ''; + return async (req: express.Request, resp: express.Response, options: ISendAppPageOptions) => { const config = makeGristConfig({ homeUrl: !isSingleUserMode() ? server.getHomeUrl(req) : null, @@ -153,6 +159,7 @@ export function makeSendAppPage(opts: { .replace("", `` + tagManagerSnippet) .replace("", preloads) .replace("", customHeadHtmlSnippet) + .replace("", insertCustomScript) .replace( "", `` diff --git a/static/app.html b/static/app.html index f87de801..fe174090 100644 --- a/static/app.html +++ b/static/app.html @@ -17,6 +17,7 @@ + <!-- INSERT TITLE --><!-- INSERT TITLE SUFFIX --> diff --git a/static/error.html b/static/error.html index fe068f02..d1b8dff5 100644 --- a/static/error.html +++ b/static/error.html @@ -8,6 +8,7 @@ + Loading...<!-- INSERT TITLE SUFFIX -->