diff options
| author | Adam Soltys <[email protected]> | 2021-08-14 04:39:34 -0400 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-08-30 16:03:09 -0700 |
| commit | 552b399de4dcd22c7d207b042ab5ca4ad9475e5a (patch) | |
| tree | a39d908484636e6fe7acd0db2c3c6c0aa50c83a2 | |
| parent | bdbe93b70d05d7f882f9b00cd563ebebb79bf086 (diff) | |
| download | coinos-server-552b399de4dcd22c7d207b042ab5ca4ad9475e5a.tar.gz coinos-server-552b399de4dcd22c7d207b042ab5ca4ad9475e5a.zip | |
startup scripts
| -rw-r--r-- | index.js | 2 | ||||
| -rw-r--r-- | startup.js | 25 |
2 files changed, 27 insertions, 0 deletions
@@ -93,6 +93,8 @@ app.use("/referrals", referralsRouter); var adminRouter = require("./routes/admin.js"); app.use("/admin", adminAuth, adminRouter); +require("./startup"); + app.use((err, req, res, next) => { const details = { path: req.path, diff --git a/startup.js b/startup.js new file mode 100644 index 00000000..807604e8 --- /dev/null +++ b/startup.js @@ -0,0 +1,25 @@ +// Can use this file to run custom scripts on startup + +/* +(async () => { + let invoice = await db.Invoice.findOne({ + where: { id: 47391 } + }); + + let payment = await db.Payment.findOne({ + where: { invoice_id: 47391 }, + + include: { + model: db.Account, + as: "account" + } + }); + + console.log(invoice.id, payment.id); + try { + await callWebhook(invoice, payment); + } catch (e) { + console.log("uh oh", e); + } +})(); +*/ |
