J'ai changé juste pour vérifier:
- nodejs
- docker
First start a database server
docker run -d -e POSTGRES_USER=vehicle -e POSTGRES_PASSWORD=vehicle -e POSTGRES_DB=vehicle -p 5432:5432 postgis/postgis:16-3.4-alpine
Then, in another terminal start the server
node dist/index.js
curl -v -XPOST -H "Content-Type: application/json" --data '{"shortcode":"abbcde", "battery": 12, "latitude": 53.43, "longitude": 43.43}' localhost:8080/vehicles | jq .
curl -v localhost:8080/vehicles
curl -v -XDELETE localhost:8080/vehicles/${vehicle_id}