diff --git a/service/index.ts b/service/index.ts index 0df7e8da..05f1f1f4 100644 --- a/service/index.ts +++ b/service/index.ts @@ -1,20 +1,15 @@ import { Elysia } from 'elysia' import { staticPlugin } from '@elysiajs/static' -new Elysia() - // .use( - // staticPlugin({ - // assets: 'dist/assets', - // prefix: '/assets', - // }), - // ) - // .get('/*', () => Bun.file('dist/index.html')) - .onError(ctx => { - if (ctx.code === 'NOT_FOUND') { - ctx.set.redirect = '/' - return '' - } - }) - .use(staticPlugin({ assets: 'dist', prefix: '/' })) - .get('/', () => Bun.file('dist/index.html')) - .listen(3000) +const app = new Elysia() + +app.use( + staticPlugin({ + assets: 'dist/assets', + prefix: '/assets', + }), +) + +app.get('/*', () => Bun.file('dist/index.html')) + +app.listen(3000)