Skip to content

Commit

Permalink
analytics tenants
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesbrandenburger committed Jan 20, 2024
1 parent 0ba66f1 commit fa8d358
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions services/analytics-service/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}`);
});
2 changes: 1 addition & 1 deletion services/analytics-service/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.1
v1.0.2
2 changes: 1 addition & 1 deletion services/pin-service/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion services/pin-service/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.6
v1.0.7

0 comments on commit fa8d358

Please sign in to comment.