summaryrefslogtreecommitdiff
path: root/src/api.mjs
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-02-23 06:05:19 -0300
committerEuAndreh <eu@euandre.org>2024-02-23 06:05:21 -0300
commitc36bf8e3577da31cf6d575879c7e92d3e9c7e4f1 (patch)
tree4fd5414e76490e297c4c770ff35e09149ef3658f /src/api.mjs
parentRemove C code and cleanup repository (diff)
downloadpapod-c36bf8e3577da31cf6d575879c7e92d3e9c7e4f1.tar.gz
papod-c36bf8e3577da31cf6d575879c7e92d3e9c7e4f1.tar.xz
Big cleanup
- delete all SQLite Node-API code: we'll use the C++ one instead; - implement hero.mjs, with tests! - use ESM all over.
Diffstat (limited to 'src/api.mjs')
-rw-r--r--src/api.mjs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/api.mjs b/src/api.mjs
new file mode 100644
index 0000000..27a14b1
--- /dev/null
+++ b/src/api.mjs
@@ -0,0 +1,24 @@
+import { eq } from "./utils.mjs";
+import * as ircd from "./ircd.mjs";
+import * as web from "./web.mjs";
+
+export const main = async () => {
+ if (process.argv.length === 3 && process.argv[2] === "-V") {
+ console.log("papo 1970-01-01 0.1.0");
+ return;
+ }
+
+ if (process.argv[2] === "ircd") {
+ await ircd.app(process.argv[3]);
+ return;
+ }
+
+ if (process.argv[2] === "web") {
+ await web.app(process.argv[3]);
+ return;
+ }
+
+ console.log({
+ argv: process.argv,
+ });
+};