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