Spaces:
Sleeping
Sleeping
Download artifacts/api-server/src/index.ts from Tahasaif3/DataExtract: direct link, hf CLI and curl.
- Browser
- Download file 786 Bytes
-
https://huggingface.co/spaces/Tahasaif3/DataExtract/resolve/main/artifacts/api-server/src/index.ts
- Command line
-
hf download hf://spaces/Tahasaif3/DataExtract/artifacts/api-server/src/index.ts
-
curl -L -o index.ts https://huggingface.co/spaces/Tahasaif3/DataExtract/resolve/main/artifacts/api-server/src/index.ts
786 Bytes
| import app from "./app"; | |
| import { logger } from "./lib/logger"; | |
| import { bootstrapAdmin } from "./lib/bootstrapAdmin"; | |
| const rawPort = process.env["PORT"]; | |
| if (!rawPort) { | |
| throw new Error( | |
| "PORT environment variable is required but was not provided.", | |
| ); | |
| } | |
| const port = Number(rawPort); | |
| if (Number.isNaN(port) || port <= 0) { | |
| throw new Error(`Invalid PORT value: "${rawPort}"`); | |
| } | |
| bootstrapAdmin().then(() => { | |
| app.listen(port, (err) => { | |
| if (err) { | |
| logger.error({ err }, "Error listening on port"); | |
| process.exit(1); | |
| } | |
| logger.info({ port }, "Server listening"); | |
| }); | |
| }).catch(error => { | |
| logger.error({ message: error instanceof Error ? error.message : 'Unknown setup failure' }, 'Admin authentication startup failed'); | |
| process.exit(1); | |
| }); | |