Download server.js from TianTianr/sy: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/spaces/TianTianr/sy/resolve/main/server.js
- Command line
-
hf download hf://spaces/TianTianr/sy/server.js
-
curl -L -o server.js https://huggingface.co/spaces/TianTianr/sy/resolve/main/server.js
669 Bytes
| import { CommandLineParser } from './src/command-line.js'; | |
| import { serverDirectory } from './src/server-directory.js'; | |
| console.log(`Node version: ${process.version}. Running in ${process.env.NODE_ENV} environment. Server directory: ${serverDirectory}`); | |
| // config.yaml will be set when parsing command line arguments | |
| const cliArgs = new CommandLineParser().parse(process.argv); | |
| globalThis.DATA_ROOT = cliArgs.dataRoot; | |
| globalThis.COMMAND_LINE_ARGS = cliArgs; | |
| process.chdir(serverDirectory); | |
| try { | |
| await import('./src/server-main.js'); | |
| } catch (error) { | |
| console.error('A critical error has occurred while starting the server:', error); | |
| } | |