Commit 8f01c4f60b
Unsigned
Layout: unified · split
api/src/api.ts +4
| @@ -1,4 +1,5 @@ | ||
| 1 | 1 | import { Hono } from 'hono'; |
| 2 | import { cors } from 'hono/cors'; | |
| 2 | 3 | import Fuse from 'fuse.js'; |
| 3 | 4 | |
| 4 | 5 | import { |
| @@ -14,6 +15,9 @@ import index from '../public/index.html' | ||
| 14 | 15 | /* Create new Hono app */ |
| 15 | 16 | const app = new Hono({ strict: false }); |
| 16 | 17 | |
| 18 | /* Enable CORS for all routes */ | |
| 19 | app.use('*', cors()); | |
| 20 | ||
| 17 | 21 | /* Serve the index page (which contains the Swagger Docs) */ |
| 18 | 22 | app.get("/", async (ctx) => { |
| 19 | 23 | if (index) { |