mirror of
https://github.com/C4illin/ConvertX.git
synced 2026-06-28 06:55:48 +00:00
bun fix
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "@bun-examples/elysia",
|
||||
"name": "convertx-frontend",
|
||||
"version": "1.0.50",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"dev": "bun run --watch src/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@elysiajs/static": "^1.0.2",
|
||||
"elysia": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
10
src/index.ts
10
src/index.ts
@@ -1,7 +1,13 @@
|
||||
import { Elysia } from "elysia";
|
||||
import { staticPlugin } from '@elysiajs/static'
|
||||
|
||||
const app = new Elysia().get("/", () => "Hello Elysia").listen(3000);
|
||||
const app = new Elysia()
|
||||
.use(staticPlugin({
|
||||
assets: "../frontend/", prefix: "/"
|
||||
}))
|
||||
.get("/", () => Bun.file("../frontend/index.html"))
|
||||
.listen(3000);
|
||||
|
||||
console.log(
|
||||
`🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`
|
||||
`🦊 Elysia is running at http://${app.server?.hostname}:${app.server?.port}`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user