Spaces:
Sleeping
Sleeping
Download src/server.ts from Wauplin/responses.js: direct link, hf CLI and curl.
- Browser
- Download file 600 Bytes
-
https://huggingface.co/spaces/Wauplin/responses.js/resolve/refs%2Fpr%2F1/src/server.ts
- Command line
-
hf download hf://spaces/Wauplin/responses.js@refs/pr/1/src/server.ts
-
curl -L -o server.ts https://huggingface.co/spaces/Wauplin/responses.js/resolve/refs%2Fpr%2F1/src/server.ts
600 Bytes
| import express, { type Express } from "express"; | |
| import { createResponseParamsSchema } from "./schemas.js"; | |
| import { validateBody } from "./middleware/validation.js"; | |
| import { requestLogger } from "./middleware/logging.js"; | |
| import { getLandingPageHtml, postCreateResponse } from "./routes/index.js"; | |
| export const createApp = (): Express => { | |
| const app: Express = express(); | |
| // Middleware | |
| app.use(requestLogger()); | |
| app.use(express.json()); | |
| // Routes | |
| app.get("/", getLandingPageHtml); | |
| app.post("/v1/responses", validateBody(createResponseParamsSchema), postCreateResponse); | |
| return app; | |
| }; | |