-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
39 lines (34 loc) Β· 1.29 KB
/
Copy pathserver.js
File metadata and controls
39 lines (34 loc) Β· 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const server = Bun.serve({
port: 3000,
async fetch(req) {
const url = new URL(req.url);
const path = url.pathname === "/" ? "/index.html" : url.pathname;
const file = Bun.file(import.meta.dir + path);
if (await file.exists()) return new Response(file);
return new Response("Not found", { status: 404 });
},
});
const teal = (s) => `\x1b[36m${s}\x1b[0m`;
const bold = (s) => `\x1b[1m${s}\x1b[0m`;
const dim = (s) => `\x1b[2m${s}\x1b[0m`;
const art = [
" .ββββββββββ.",
" / β
\\",
" (ββββββββββββββ)",
" | (o) ββ β |",
" | ββββββββββ |",
" | Β· \\___/ Β· |",
" \\______________/",
"",
" βββββ€ββββ€ββββ€ββββ€ββββ€ββββ€ββββ",
" β ~ β ~ β ~ β ~ β ~ β ~ β ~ β",
" β ~ β ~ β ~ β ~ β ~ β ~ β ~ β",
" β ~ β ~ β ~ β ~ β ~ β ~ β ~ β",
" β ~ β ~ β ~ β ~ β ~ β ~ β ~ β",
" βββββ§ββββ§ββββ§ββββ§ββββ§ββββ§ββββ",
].join("\n");
console.log(`
${teal(art)}
${bold("B L I P !")} ${dim("β hunt the hidden beasts")}
${dim(`β http://localhost:${server.port}`)}
`);