aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2020-09-30 21:06:07 +0200
committerMarvin Borner2020-09-30 21:06:07 +0200
commitdce15366d697aaa4f2a1f2e27c1e05eb4fa87120 (patch)
treed4da463067c75f0792a5d18435568e8598bb0a2f
parent3491013c43775401b5e87f97c09d906de5bafbc9 (diff)
Fixed res.send (LARS IS STILL DUMB) and commented
-rw-r--r--motto/index.js41
1 files changed, 20 insertions, 21 deletions
diff --git a/motto/index.js b/motto/index.js
index 4b39960..77365a8 100644
--- a/motto/index.js
+++ b/motto/index.js
@@ -11,27 +11,26 @@ const apiLimiter = rateLimit({
message: "Access overflow!",
});
-app.get("/sync", (req, res) => {
- fs.readFile(__dirname + "/list.txt", "utf8", (err, data) => {
- if (err) {
- console.error(err);
- return res.send("error");
- }
- const lines = data.split("\n");
- lines.forEach(async (line) => {
- const split = line.split(" - ");
- try {
- if (split.length >= 2)
- await db.query("INSERT INTO theme (main, description) VALUES (?, ?)", split.slice(0, 2));
- else console.log(line);
- } catch (e) {
- console.error(e);
- } finally {
- res.send("ok");
- }
- });
- });
-});
+//app.get("/sync", (req, res) => {
+// fs.readFile(__dirname + "/list.txt", "utf8", (err, data) => {
+// if (err) {
+// console.error(err);
+// return res.send("error");
+// }
+// const lines = data.split("\n");
+// lines.forEach(async (line) => {
+// const split = line.split(" - ");
+// try {
+// if (split.length >= 2)
+// await db.query("INSERT INTO theme (main, description) VALUES (?, ?)", split.slice(0, 2));
+// else console.log(line);
+// } catch (e) {
+// console.error(e);
+// }
+// });
+// res.send("ok");
+// });
+//});
app.use("/", express.static(__dirname + "/public"));