diff --git a/services/analytics-service/index.js b/services/analytics-service/index.js index 16c7621..6b12784 100644 --- a/services/analytics-service/index.js +++ b/services/analytics-service/index.js @@ -24,13 +24,14 @@ const app = express(); const port = 3004; app.use(express.json()); app.use(cookieParser()); -app.use(auth); +// app.use(auth); // define routes -app.get("/", async (req, res) => { +app.get("/:tenant", async (req, res) => { + const tenant = req.params.tenant; // get the analytics state - const analyticsState = await analyticsStateCollection.find({}).sort({ timestamp: -1 }).limit(1).next(); + const analyticsState = await analyticsStateCollection.find({ tenant: tenant }).sort({ timestamp: -1 }).limit(1).next(); if (!analyticsState) { res.status(400).send("No analytics state found"); return; @@ -42,5 +43,5 @@ app.get("/", async (req, res) => { // start the server app.listen(port, () => { - console.log(`Heatmap service listening at http://localhost:${port}`); + console.log(`Analytics service listening at http://localhost:${port}`); }); \ No newline at end of file diff --git a/services/analytics-service/version.txt b/services/analytics-service/version.txt index 6a2b0ac..b482243 100644 --- a/services/analytics-service/version.txt +++ b/services/analytics-service/version.txt @@ -1 +1 @@ -v1.0.1 \ No newline at end of file +v1.0.2 \ No newline at end of file diff --git a/services/pin-service/index.js b/services/pin-service/index.js index 2207f58..885964f 100644 --- a/services/pin-service/index.js +++ b/services/pin-service/index.js @@ -34,7 +34,7 @@ app.post("/", async (req, res) => { description: req.body.description, latitude: req.body.latitude, longitude: req.body.longitude, - date: req.body.date, + date: req.body.date || new Date().toISOString(), companions: req.body.companions, duration: req.body.duration, rating: req.body.rating, diff --git a/services/pin-service/version.txt b/services/pin-service/version.txt index 6df8b11..ef6a92d 100644 --- a/services/pin-service/version.txt +++ b/services/pin-service/version.txt @@ -1 +1 @@ -v1.0.6 \ No newline at end of file +v1.0.7 \ No newline at end of file