add web
This commit is contained in:
parent
d3f27a7101
commit
9c4ad4929c
5
web/deno.jsonc
Normal file
5
web/deno.jsonc
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"fmt": {
|
||||
"indentWidth": 4
|
||||
}
|
||||
}
|
84
web/deno.lock
Normal file
84
web/deno.lock
Normal file
@ -0,0 +1,84 @@
|
||||
{
|
||||
"version": "3",
|
||||
"packages": {
|
||||
"specifiers": {
|
||||
"jsr:@oak/commons@^1.0": "jsr:@oak/commons@1.0.0",
|
||||
"jsr:@oak/oak": "jsr:@oak/oak@17.1.3",
|
||||
"jsr:@std/assert@^1.0": "jsr:@std/assert@1.0.8",
|
||||
"jsr:@std/bytes@^1.0": "jsr:@std/bytes@1.0.4",
|
||||
"jsr:@std/bytes@^1.0.2": "jsr:@std/bytes@1.0.4",
|
||||
"jsr:@std/crypto@^1.0": "jsr:@std/crypto@1.0.3",
|
||||
"jsr:@std/encoding@^1.0": "jsr:@std/encoding@1.0.5",
|
||||
"jsr:@std/encoding@^1.0.5": "jsr:@std/encoding@1.0.5",
|
||||
"jsr:@std/http@^1.0": "jsr:@std/http@1.0.10",
|
||||
"jsr:@std/io@0.224": "jsr:@std/io@0.224.9",
|
||||
"jsr:@std/media-types@^1.0": "jsr:@std/media-types@1.1.0",
|
||||
"jsr:@std/path@^1.0": "jsr:@std/path@1.0.8",
|
||||
"npm:path-to-regexp@6.2.1": "npm:path-to-regexp@6.2.1"
|
||||
},
|
||||
"jsr": {
|
||||
"@oak/commons@1.0.0": {
|
||||
"integrity": "49805b55603c3627a9d6235c0655aa2b6222d3036b3a13ff0380c16368f607ac",
|
||||
"dependencies": [
|
||||
"jsr:@std/assert@^1.0",
|
||||
"jsr:@std/bytes@^1.0",
|
||||
"jsr:@std/crypto@^1.0",
|
||||
"jsr:@std/encoding@^1.0",
|
||||
"jsr:@std/http@^1.0",
|
||||
"jsr:@std/media-types@^1.0"
|
||||
]
|
||||
},
|
||||
"@oak/oak@17.1.3": {
|
||||
"integrity": "d89296c22db91681dd3a2a1e1fd14e258d0d5a9654de55637aee5b661c159f33",
|
||||
"dependencies": [
|
||||
"jsr:@oak/commons@^1.0",
|
||||
"jsr:@std/assert@^1.0",
|
||||
"jsr:@std/bytes@^1.0",
|
||||
"jsr:@std/crypto@^1.0",
|
||||
"jsr:@std/http@^1.0",
|
||||
"jsr:@std/io@0.224",
|
||||
"jsr:@std/media-types@^1.0",
|
||||
"jsr:@std/path@^1.0",
|
||||
"npm:path-to-regexp@6.2.1"
|
||||
]
|
||||
},
|
||||
"@std/assert@1.0.8": {
|
||||
"integrity": "ebe0bd7eb488ee39686f77003992f389a06c3da1bbd8022184804852b2fa641b"
|
||||
},
|
||||
"@std/bytes@1.0.4": {
|
||||
"integrity": "11a0debe522707c95c7b7ef89b478c13fb1583a7cfb9a85674cd2cc2e3a28abc"
|
||||
},
|
||||
"@std/crypto@1.0.3": {
|
||||
"integrity": "a2a32f51ddef632d299e3879cd027c630dcd4d1d9a5285d6e6788072f4e51e7f"
|
||||
},
|
||||
"@std/encoding@1.0.5": {
|
||||
"integrity": "ecf363d4fc25bd85bd915ff6733a7e79b67e0e7806334af15f4645c569fefc04"
|
||||
},
|
||||
"@std/http@1.0.10": {
|
||||
"integrity": "4e32d11493ab04e3ef09f104f0cb9beb4228b1d4b47c5469573c2c294c0d3692",
|
||||
"dependencies": [
|
||||
"jsr:@std/encoding@^1.0.5"
|
||||
]
|
||||
},
|
||||
"@std/io@0.224.9": {
|
||||
"integrity": "4414664b6926f665102e73c969cfda06d2c4c59bd5d0c603fd4f1b1c840d6ee3",
|
||||
"dependencies": [
|
||||
"jsr:@std/bytes@^1.0.2"
|
||||
]
|
||||
},
|
||||
"@std/media-types@1.1.0": {
|
||||
"integrity": "c9d093f0c05c3512932b330e3cc1fe1d627b301db33a4c2c2185c02471d6eaa4"
|
||||
},
|
||||
"@std/path@1.0.8": {
|
||||
"integrity": "548fa456bb6a04d3c1a1e7477986b6cffbce95102d0bb447c67c4ee70e0364be"
|
||||
}
|
||||
},
|
||||
"npm": {
|
||||
"path-to-regexp@6.2.1": {
|
||||
"integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==",
|
||||
"dependencies": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"remote": {}
|
||||
}
|
21
web/main.ts
Normal file
21
web/main.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { Application, Router } from "jsr:@oak/oak";
|
||||
|
||||
const app = new Application();
|
||||
|
||||
const router = new Router();
|
||||
|
||||
app.use(router.routes());
|
||||
app.use(router.allowedMethods());
|
||||
|
||||
app.use(async (ctx, next) => {
|
||||
try {
|
||||
await ctx.send({ root: "./public", index: "index.html" });
|
||||
} catch {
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
||||
const port = 8000;
|
||||
const listener = app.listen({ port });
|
||||
console.log(`Listening at http://localhost:${port}/`);
|
||||
await listener;
|
9
web/public/index.html
Normal file
9
web/public/index.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<h1>slige</h1>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user