-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
31 lines (26 loc) · 1.07 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const express = require("express");
const activeVisitorsRouter = require("./routers/active-visitors.js");
const dataIndexingRouter = require("./routers/data-indexing.js");
const identifierRouter = require("./routers/identifier.js");
const database = require("./utils/db");
const identifierController = require("./controllers/identifier");
const analrouter = require("./routers/anal.js")
const app = express();
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
database.connect();
// const temp = async (database) => {
// await database.connect();
// identifierController.deleteOldLogsOfDataIndexing();
// identifierController.deleteOldLogsOfActiveVisitors();
// };
// temp(database);
app.post("/data", (req, res) => {
res.send("Data received");
});
app.use("/activevisitors", activeVisitorsRouter);
app.use("/dataindexing", dataIndexingRouter);
app.use("/identifier", identifierRouter);
app.use("/total24value",analrouter)
// cron job to delete old logs and store uid linked with timeline
app.listen(3000, () => console.log("Server running on port 3000"));