Download apps/server/src/http-app.ts from Leon4gr45/automaker: direct link, hf CLI and curl.
- Browser
- Download file 726 Bytes
-
https://huggingface.co/spaces/Leon4gr45/automaker/resolve/main/apps/server/src/http-app.ts
- Command line
-
hf download hf://spaces/Leon4gr45/automaker/apps/server/src/http-app.ts
-
curl -L -o http-app.ts https://huggingface.co/spaces/Leon4gr45/automaker/resolve/main/apps/server/src/http-app.ts
726 Bytes
| import express from 'express'; | |
| import cookieParser from 'cookie-parser'; | |
| import { jsonParserErrorHandler } from './middleware/json-errors.js'; | |
| import { requireJsonContentType } from './middleware/require-json-content-type.js'; | |
| /** Production transport assembly, shared by the actual startup and integration tests. */ | |
| export function createHttpApplication( | |
| options: { | |
| beforeParsing?: (app: express.Express) => void; | |
| routes?: (app: express.Express) => void; | |
| } = {} | |
| ) { | |
| const app = express(); | |
| options.beforeParsing?.(app); | |
| app.use(express.json({ limit: '50mb' })); | |
| app.use(cookieParser()); | |
| app.use(jsonParserErrorHandler); | |
| app.use('/api', requireJsonContentType); | |
| options.routes?.(app); | |
| return app; | |
| } | |