This project deploys a Swagger UI interface using Cloudflare Workers, serving your OpenAPI/Swagger documentation with a modern, responsive UI.
- Node.js (v16 or later)
- npm or yarn or bun
- Cloudflare account
- Wrangler CLI (installed via npm)
-
Install dependencies:
npm install
-
Login to Cloudflare (if not already logged in):
npx wrangler login
To run the project locally:
-
Clone the repository:
git clone https://github.com/dashnex/api-docs cd api-docs
-
Install dependencies:
npm install
-
Start the local development server:
npm run dev
The development server will start at http://localhost:8787/docs
by default. Any changes you make to the code will automatically trigger a reload of the development server.
Note: If port 8787 is already in use, Wrangler will automatically select the next available port.
To deploy to Cloudflare Workers:
npm run deploy
public/
- Contains static assets (index.html and swagger.json)src/
- Contains the Worker codewrangler.toml
- Cloudflare Workers configurationtsconfig.json
- TypeScript configuration
To update the Swagger documentation, add the public/*.json
file with your own OpenAPI/Swagger specification and update public/index.html
.