huggingface/openapi
80
1import { apiReference } from "@scalar/express-api-reference";2import express from "express";3 4const app = express();5 6app.use("/", (req, res, next) => { 7 return apiReference({8 url: "https://huggingface.co/.well-known/openapi.json",9 title: "Hub API Endpoints",10 pageTitle: "Hub API Endpoints",11 hideClientButton: true,12 defaultOpenAllTags: true,13 onSidebarClick: (href) => {14 const url = new URL(href);15 parent.postMessage({ hash: url.hash.slice(1) }, '*');16 },17 })(req, res);18});19 20const port = 7860;21 22app.listen(port, () => {23 console.log(`Server running on port ${port}`);24});25 