diff --git a/deno.json b/deno.json index 46ce31b..b05ce05 100644 --- a/deno.json +++ b/deno.json @@ -3,9 +3,9 @@ "tasks": { "server-dev": "deno run -A --unstable --watch=static/,routes/ server-dev.ts", "test": "deno test --allow-read=./ --allow-net --allow-write=./ --allow-run=tasklist.exe --unstable", - "run": "deno run --allow-read=./ --allow-write=./ --allow-run=tasklist.exe --allow-net --unstable", - "compile": "deno compile --allow-read=./ --allow-write=./ --allow-run=tasklist.exe --allow-net --unstable", - "compile_full": "deno compile --allow-read --allow-write --allow-run=tasklist.exe --allow-net --unstable" + "run": "deno run --allow-read=./ --allow-write=./ --allow-run=tasklist.exe --allow-env=DENO_DEPLOYMENT_ID --allow-net --unstable", + "compile": "deno compile --allow-read=./ --allow-write=./ --allow-run=tasklist.exe --allow-env=DENO_DEPLOYMENT_ID --allow-net --unstable", + "compile_full": "deno compile --allow-read --allow-write --allow-run=tasklist.exe --allow-env=DENO_DEPLOYMENT_ID --allow-net --unstable" }, "fmt": { "indentWidth": 4, diff --git a/main.ts b/main.ts index f456cc6..06940e7 100644 --- a/main.ts +++ b/main.ts @@ -7,6 +7,7 @@ import { sure_dir, try_remove_sync } from "./utils.ts"; import { EhDb } from "./db.ts"; import { load_eht_file, update_database_tag } from "./eh_translation.ts"; import { get_abort_signal } from "./signal_handler.ts"; +import { startServer } from "./server.ts"; function show_help() { console.log("Usage: main.ts [options]"); @@ -23,6 +24,7 @@ enum CMD { Optimize, UpdateTagTranslation, ExportZip, + Server, } const args = parse(Deno.args, { @@ -46,6 +48,7 @@ if (rcmd == "utt" || rcmd == "update_tag_translation") { cmd = CMD.UpdateTagTranslation; } if (rcmd == "ez" || rcmd == "export_zip") cmd = CMD.ExportZip; +if (rcmd == "s" || rcmd == "server") cmd = CMD.Server; if (cmd == CMD.Unknown) { throw Error(`Unknown command: ${rcmd}`); } @@ -129,6 +132,8 @@ async function main() { await update_tag_translation(); } else if (cmd == CMD.ExportZip) { await export_zip(); + } else if (cmd == CMD.Server) { + await startServer(settings); } }