Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download app.ts from huggingface/openapi: direct link, hf CLI and curl.
- Browser
- Download file 593 Bytes
-
https://huggingface.co/spaces/huggingface/openapi/resolve/main/app.ts
- Command line
-
hf download hf://spaces/huggingface/openapi/app.ts
-
curl -L -o app.ts https://huggingface.co/spaces/huggingface/openapi/resolve/main/app.ts
593 Bytes
| import { apiReference } from "@scalar/express-api-reference"; | |
| import express from "express"; | |
| const app = express(); | |
| app.use("/", (req, res, next) => { | |
| return apiReference({ | |
| url: "https://huggingface.co/.well-known/openapi.json", | |
| title: "Hub API Endpoints", | |
| pageTitle: "Hub API Endpoints", | |
| hideClientButton: true, | |
| defaultOpenAllTags: true, | |
| onSidebarClick: (href) => { | |
| const url = new URL(href); | |
| parent.postMessage({ hash: url.hash.slice(1) }, '*'); | |
| }, | |
| })(req, res); | |
| }); | |
| const port = 7860; | |
| app.listen(port, () => { | |
| console.log(`Server running on port ${port}`); | |
| }); | |