index.js 369 B

123456789101112131415
  1. import { Elysia } from 'elysia'
  2. import routes from './routes'
  3. new Elysia()
  4. .use(routes)
  5. .get('/assets/*', async ({ params, status }) => {
  6. const file = Bun.file(`./assets/${params["*"]}`)
  7. if (!(await file.exists())) return status(404, "not found")
  8. return file;
  9. })
  10. .listen({ hostname: "127.0.0.1", port: 3000 })
  11. console.log(`running on port 3000`)