Blame Raw
· · · 17 lines (669 B)
0 contributors
1#!/usr/bin/env node
2import { CommandLineParser } from './src/command-line.js';
3import { serverDirectory } from './src/server-directory.js';
4
5console.log(`Node version: ${process.version}. Running in ${process.env.NODE_ENV} environment. Server directory: ${serverDirectory}`);
6
7// config.yaml will be set when parsing command line arguments
8const cliArgs = new CommandLineParser().parse(process.argv);
9globalThis.DATA_ROOT = cliArgs.dataRoot;
10globalThis.COMMAND_LINE_ARGS = cliArgs;
11process.chdir(serverDirectory);
12
13try {
14 await import('./src/server-main.js');
15} catch (error) {
16 console.error('A critical error has occurred while starting the server:', error);
17}