import { Application, Static, Router, __dirname } from "./deps.ts";import { addr } from "./config.ts";import ws from "./ws.ts";import { css, html, js } from "./files.ts";
const app = new Application(addr);
ws(app);
const WWW = __dirname(import.meta) + "/www";const INDEX = WWW + "/index.html";
const router = new Router();router.get("/index.css", async (req, res) => await res.type("text/css").end(css));router.get("/index.js", async (req, res) => await res.type("application/javascript").end(js));
app.use(new Static(WWW));app.use(router);app.use(async (req, res) => await res.type("text/html").end(html));
console.log(app.origin);
await app.start();