From 4900a351ee78fcecf3050cf0a28696548646cd1a Mon Sep 17 00:00:00 2001 From: Geoff Rich <4992896+geoffrich@users.noreply.github.com> Date: Thu, 16 Mar 2023 16:56:29 -0700 Subject: [PATCH] fix: await server init (#128) --- files/entry.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/entry.js b/files/entry.js index a741577..01cccbd 100644 --- a/files/entry.js +++ b/files/entry.js @@ -14,7 +14,7 @@ const debug = DEBUG; installPolyfills(); const server = new Server(manifest); -server.init({ env: process.env }); +const initialized = server.init({ env: process.env }); /** * @typedef {import('@azure/functions').AzureFunction} AzureFunction @@ -35,6 +35,7 @@ export async function index(context) { const ipAddress = getClientIPFromHeaders(request.headers); const clientPrincipal = getClientPrincipalFromHeaders(request.headers); + await initialized; const rendered = await server.respond(request, { getClientAddress() { return ipAddress;