aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-12-06 06:03:55 +0000
committerJohn Barratt <[email protected]>2022-12-06 09:08:35 -0800
commit5fcca32bdfc1887e7c86a4c5f06560374469fa25 (patch)
tree2dd1802097ca750fbee4217852c522ca6b5c5e17
parent26b7b15ca7ad8e28870e895b6271dc3041511496 (diff)
downloadcoinos-server-5fcca32bdfc1887e7c86a4c5f06560374469fa25.tar.gz
coinos-server-5fcca32bdfc1887e7c86a4c5f06560374469fa25.zip
missing index file
-rw-r--r--index.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/index.js b/index.js
new file mode 100644
index 00000000..759893dc
--- /dev/null
+++ b/index.js
@@ -0,0 +1,45 @@
+import app from "./app";
+import persist from "./lib/persist";
+import config from "./config/index";
+import store from "./lib/store";
+import { l, err } from "./lib/logging";
+import { optionalAuth } from "$lib/passport";
+
+import "./db";
+import "./lib/redis";
+import "./lib/sockets";
+import "./lib/webhooks";
+import "./lib/passport";
+import "./lib/upload";
+import "./lib/sync";
+import "./lib/rates";
+import "./lib/notifications";
+import "./lib/mail";
+
+import "./routes/assets";
+import "./routes/locations";
+import "./routes/info";
+import "./routes/users";
+import "./routes/invoices";
+import "./routes/payments";
+import "./routes/requests";
+import "./routes/lnurl";
+import "./routes/tickets";
+
+if (config.bitcoin) store.networks.push("bitcoin");
+if (config.liquid) store.networks.push("liquid");
+if (config.lna) store.networks.push("lightning");
+
+let host = process.env.HOST || "0.0.0.0";
+let port = process.env.PORT || 3119;
+
+app.post('/echo', optionalAuth, async (req, res) => {
+ console.log(req.user.username)
+ console.log(req.body)
+ res.send(req.body);
+});
+
+app.listen({ host, port }, (e, address) => {
+ e && err(e) && process.exit(1);
+ l(`CoinOS Server listening on ${address}`);
+});