Skip to content

Commit

Permalink
fix: await server init (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrich committed Mar 16, 2023
1 parent 71d0f72 commit 4900a35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion files/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 4900a35

Please sign in to comment.