Spaces:
Sleeping
Sleeping
Download artifacts/api-server/src/app.ts from drewinspirit/lung-detect: direct link, hf CLI and curl.
- Browser
- Download file 656 Bytes
-
https://huggingface.co/spaces/drewinspirit/lung-detect/resolve/main/artifacts/api-server/src/app.ts
- Command line
-
hf download hf://spaces/drewinspirit/lung-detect/artifacts/api-server/src/app.ts
-
curl -L -o app.ts https://huggingface.co/spaces/drewinspirit/lung-detect/resolve/main/artifacts/api-server/src/app.ts
656 Bytes
| import express, { type Express } from "express"; | |
| import cors from "cors"; | |
| import pinoHttp from "pino-http"; | |
| import router from "./routes"; | |
| import { logger } from "./lib/logger"; | |
| const app: Express = express(); | |
| app.use( | |
| pinoHttp({ | |
| logger, | |
| serializers: { | |
| req(req) { | |
| return { | |
| id: req.id, | |
| method: req.method, | |
| url: req.url?.split("?")[0], | |
| }; | |
| }, | |
| res(res) { | |
| return { | |
| statusCode: res.statusCode, | |
| }; | |
| }, | |
| }, | |
| }), | |
| ); | |
| app.use(cors()); | |
| app.use(express.json()); | |
| app.use(express.urlencoded({ extended: true })); | |
| app.use("/api", router); | |
| export default app; | |