Fix CORS, allow for client-side and cross-origin GET requests

This commit is contained in:
Alicia Sykes 2024-03-09 15:34:29 +00:00
parent 0720acdb7b
commit 8f01c4f60b

View file

@ -1,4 +1,5 @@
import { Hono } from 'hono';
import { cors } from 'hono/cors';
import Fuse from 'fuse.js';
import {
@ -14,6 +15,9 @@ import index from '../public/index.html'
/* Create new Hono app */
const app = new Hono({ strict: false });
/* Enable CORS for all routes */
app.use('*', cors());
/* Serve the index page (which contains the Swagger Docs) */
app.get("/", async (ctx) => {
if (index) {