aboutsummaryrefslogtreecommitdiff
path: root/src/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.ts')
-rw-r--r--src/main.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main.ts b/src/main.ts
index 29dc789..bcdb632 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,9 +1,11 @@
-import { Application } from "https://deno.land/x/abc@v1/mod.ts";
+import { Application, Context } from "https://deno.land/x/abc@v1/mod.ts";
+import "https://deno.land/x/dotenv/load.ts";
+const port = parseInt(Deno.env.get("PORT") || "8080");
const app = new Application();
-console.log("Started server!");
+app.static("/", "./src/public/"); // Manage static files
+app.file("/", "./src/public/index.html"); // Render index on /
-app.get("/", (c) => {
- return "Hello, world!";
-}).start({ port: 8080 });
+app.start({ port });
+console.log(`Server listening on http://localhost:${port}`);