From 833af735cfebb9d32d362c28164da5e9797fae6d Mon Sep 17 00:00:00 2001 From: SimonFJ20 Date: Thu, 26 Sep 2024 01:07:02 +0200 Subject: [PATCH] add env --- .env.example | 1 + .gitignore | 2 ++ deno.jsonc | 4 +++- main.ts | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3646d14 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +PORT=8000 diff --git a/.gitignore b/.gitignore index 1f33a07..bbb42eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +bunker bunker.db files/ +.env diff --git a/deno.jsonc b/deno.jsonc index 5c4db37..4a97855 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -4,6 +4,8 @@ "indentWidth": 4 }, "tasks": { - "check": "deno check main.ts" + "check": "deno check main.ts", + "dev": "deno run -A --unstable-ffi --env main.ts", + "compile": "deno compile --allow-net --allow-read --allow-env --allow-write --allow-ffi --allow-run --unstable-ffi --env main.ts" } } diff --git a/main.ts b/main.ts index 16fe1a7..47d3df5 100644 --- a/main.ts +++ b/main.ts @@ -235,4 +235,4 @@ new oak.Application() index: "index.html", }); }) - .listen({ port: 8000 }); + .listen({ port: parseInt(Deno.env.get("PORT")!) });