Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracts config.json into its own module #1061

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moved config load into main()
  • Loading branch information
Spoffy committed Jun 25, 2024
commit 7592540cc1e1d81dba3bcc796dd493dadc6ddbbd
5 changes: 3 additions & 2 deletions app/server/mergedServerMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export async function main(port: number, serverTypes: ServerType[],
const includeStatic = serverTypes.includes("static");
const includeApp = serverTypes.includes("app");

options.settings ??= await getGlobalConfig();

const server = new FlexServer(port, `server(${serverTypes.join(",")})`, options);

// We need to know early on whether we will be serving plugins or not.
Expand Down Expand Up @@ -196,7 +198,6 @@ export async function main(port: number, serverTypes: ServerType[],

export async function startMain() {
try {
const config = await getGlobalConfig();

const serverTypes = parseServerTypes(process.env.GRIST_SERVERS);

Expand All @@ -207,7 +208,7 @@ export async function startMain() {

const port = parseInt(process.env.GRIST_PORT, 10);

const server = await main(port, serverTypes, { settings: config });
const server = await main(port, serverTypes);

const opt = process.argv[2];
if (opt === '--testingHooks') {
Expand Down