forked from rhdemo/2021-dashboard-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
drash_app.ts
41 lines (36 loc) · 1015 Bytes
/
drash_app.ts
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
40
import { Drash } from "https://deno.land/x/[email protected]/mod.ts";
import { Tengine } from "https://deno.land/x/[email protected]/tengine/mod.ts";
import { DashboardResource } from "./src/dashboard.ts";
import { ScriptsResource } from "./src/scripts.ts";
import { ReplayResource } from "./src/replay.ts";
const tengine = Tengine({
render: (...args: unknown[]): boolean => {
return false;
},
views_path: "./assets/html"
});
const server = new Drash.Http.Server({
directory: ".",
response_output: "text/html",
static_paths: {
"/css":"./assets/css",
"/fonts": "./assets/fonts",
"/img": "./assets/img",
"/data": "./assets/data"
},
resources: [
DashboardResource,
ReplayResource,
ScriptsResource
],
middleware: {
after_resource: [
tengine
]
}
});
server.run({
hostname: "0.0.0.0",
port: 8000
});
console.log(`Server running at ${server.hostname}:${server.port}`);