aboutsummaryrefslogtreecommitdiff
path: root/source/server/index.ts
diff options
context:
space:
mode:
authormetamuffin <yvchraiqi@protonmail.com>2022-05-26 11:27:13 +0200
committermetamuffin <yvchraiqi@protonmail.com>2022-05-26 11:27:13 +0200
commitdc69f1577444fc9860231470d6a40136ed4688c6 (patch)
tree1c652747969308756db1fea20da24bc578d10a24 /source/server/index.ts
parent5bf043e641576d04b5b2ccdd3d10059af99b58c8 (diff)
downloadkeks-meet-dc69f1577444fc9860231470d6a40136ed4688c6.tar
keks-meet-dc69f1577444fc9860231470d6a40136ed4688c6.tar.bz2
keks-meet-dc69f1577444fc9860231470d6a40136ed4688c6.tar.zst
Deno.emit was removed
Diffstat (limited to 'source/server/index.ts')
-rw-r--r--source/server/index.ts14
1 files changed, 6 insertions, 8 deletions
diff --git a/source/server/index.ts b/source/server/index.ts
index 3fc32ce..f77d8a5 100644
--- a/source/server/index.ts
+++ b/source/server/index.ts
@@ -1,12 +1,10 @@
-import { Application, Router, RouterContext, send } from "https://deno.land/x/oak/mod.ts";
+import { Application, Router, RouterContext, send } from "https://deno.land/x/oak@v10.4.0/mod.ts";
import { api } from "./room.ts";
+import { bundle } from "https://deno.land/x/emit@0.1.1/mod.ts";
const app = new Application()
-
const root = new Router()
-let bundleFiles: Record<string, string> = {}
-
root.get("/", async c => { await c.send({ path: "index.html", root: `${Deno.cwd()}/public` }) })
root.get("/room/:id", async c => { await c.send({ path: "index.html", root: `${Deno.cwd()}/public` }) })
@@ -25,8 +23,8 @@ function respondWithType(mimeType: string, f: () => string): (c: RouterContext<a
}
}
-root.get("/bundle.js", respondWithType("application/javascript", () => bundleFiles["deno:///bundle.js"]))
-root.get("/bundle.js.map", respondWithType("application/javascript", () => bundleFiles["deno:///bundle.js.map"]))
+let bundle_code = ""
+root.get("/bundle.js", respondWithType("application/javascript", () => bundle_code))
function mountFilesystem(r: Router, route: string, path: string) {
r.get(route + "/(.*)", async (context) => {
@@ -62,8 +60,8 @@ async function refresh() {
refresh_pending = true
try {
- const { files } = await Deno.emit("source/client/index.ts", { bundle: "module", check: false })
- bundleFiles = files
+ const { code } = await bundle("source/client/index.ts", { compilerOptions: { checkJs: false } })
+ bundle_code = code
} catch (e) { console.error(e) }
refresh_pending = false