aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-06-09 17:27:36 -0400
committerAdam Soltys <[email protected]>2022-06-09 17:27:53 -0400
commitc1dff6b22b1e9659943be4ab98b9e0c06e4b11e2 (patch)
tree611dedd4d9d81483b23bd2acd9eb53d746b7933d
parent3ae8bf7c50f7a1a845de0ae1387b8fec8ae77b4f (diff)
downloadcoinos-server-c1dff6b22b1e9659943be4ab98b9e0c06e4b11e2.tar.gz
coinos-server-c1dff6b22b1e9659943be4ab98b9e0c06e4b11e2.zip
capture email endpoint
-rw-r--r--index.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/index.js b/index.js
index d98e0df0..07576f11 100644
--- a/index.js
+++ b/index.js
@@ -104,6 +104,16 @@ app.use("/admin", adminAuth, adminRouter);
require("./startup");
+app.post("/email", async (req, res) => {
+ try {
+ let file = persist("data/emails.json");
+ file.emails = [...file.emails, req.body];
+ res.send({ ok: true });
+ } catch (e) {
+ console.log(e);
+ }
+});
+
app.use((err, req, res, next) => {
const details = {
path: req.path,