add html plugin
This commit is contained in:
parent
277e70318d
commit
b0c2dba1d6
6 changed files with 24 additions and 2 deletions
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
|
|
@ -6,6 +6,7 @@
|
||||||
"dev": "bun run --watch src/index.ts"
|
"dev": "bun run --watch src/index.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@elysiajs/html": "^1.0.2",
|
||||||
"@elysiajs/static": "^1.0.2",
|
"@elysiajs/static": "^1.0.2",
|
||||||
"elysia": "latest"
|
"elysia": "latest"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
import { Elysia } from "elysia";
|
import { Elysia } from "elysia";
|
||||||
import { staticPlugin } from '@elysiajs/static'
|
import { staticPlugin } from '@elysiajs/static'
|
||||||
|
import { html } from '@elysiajs/html'
|
||||||
|
|
||||||
const app = new Elysia()
|
const app = new Elysia()
|
||||||
|
.use(html())
|
||||||
.use(staticPlugin({
|
.use(staticPlugin({
|
||||||
assets: "../frontend/", prefix: "/"
|
assets: "src/public/", prefix: "/"
|
||||||
}))
|
}))
|
||||||
.get("/", () => Bun.file("../frontend/index.html"))
|
.get("/", () => Bun.file("src/pages/index.html"))
|
||||||
.listen(3000);
|
.listen(3000);
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
|
|
|
||||||
15
src/pages/index.html
Normal file
15
src/pages/index.html
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>ConvertX</title>
|
||||||
|
<link rel="stylesheet" href="pico.lime.min.css">
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main class="container">
|
||||||
|
<h1>Hello world!</h1>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
4
src/public/pico.lime.min.css
vendored
Normal file
4
src/public/pico.lime.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
0
src/public/style.css
Normal file
0
src/public/style.css
Normal file
Loading…
Add table
Add a link
Reference in a new issue