Skip to content

Commit 2768e11

Browse files
committed
URL
1 parent 0b213f8 commit 2768e11

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

services/api/server.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ fastify.post(
194194
ip: { type: "string", format: "ipv4", description: "IP address of the sensor." },
195195
espID: { type: "string", description: "Unique ID of the sensor." },
196196
},
197-
required: ["ip"],
197+
required: ["ip", "espID"],
198198
},
199199
response: {
200200
200: {
@@ -213,10 +213,10 @@ fastify.post(
213213

214214
console.log("Adding sensor:", newSensor);
215215

216-
// Check if same sensor already exists
217-
const existingSensor = await sensors.findOne({ ip, espID });
216+
// Check if sensor with the same espID already exists
217+
const existingSensor = await sensors.findOne({ espID });
218218
if (existingSensor) {
219-
reply.code(400).send({ error: "Sensor already exists." });
219+
reply.code(400).send({ error: "Sensor with this espID already exists." });
220220
return;
221221
}
222222

services/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
- action: rebuild
1616
path: ./web-nuxt
1717
environment:
18-
- NUXT_PUBLIC_API_BASE_URL=http://api:3000
18+
- NUXT_PUBLIC_API_BASE_URL=http://vazypi.local:9051
1919
db:
2020
build: ./db
2121
container_name: climate-db

0 commit comments

Comments
 (0)