Minimal Express.js server scaffold.
- Install dependencies
npm install- Run server
npm startFor development with auto-reload (requires nodemon):
npm run devEndpoints:
GET /— health/statusGET /health— 200 OKPOST /echo— echoes posted JSON
Tracking endpoints (in-memory store):
GET /locations— list all locationsPOST /locations— create a location- Body JSON:
{ "userId": "<string>", "lat": <number>, "lng": <number>, "timestamp": "<ISO string (optional)>" } - Example:
- Body JSON:
curl -X POST http://localhost:3000/locations \
-H "Content-Type: application/json" \
-d '{"userId":"user-123","lat":37.78,"lng":-122.41}'GET /locations/:id— get location by idPUT /locations/:id— update location (same body as POST)DELETE /locations/:id— delete locationGET /users/:userId/locations— list locations for a specific user