To run a receiver app on a PC, follow the sequence described here:
- Install and launch a PostgreSQL container:
docker run --rm --name postgres-container -e POSTGRES_PASSWORD=password -it -p 5433:5432 postgresdocker exec -it postgres-container createdb -U postgres iot-book
- Create the receiver folder.
- Create the ./receiver/package.json file with the following content:
{"name": "receiver","version": "1.0.0","description": "","main": "index.js","scripts": { "start": "node index.js", "test": "echo \"Error: no test specified\" && exit 1"},"author": "","license": "ISC","dependencies": { "pg": "^6.2.3"}}
- Create the ./receiver/index.js file with the following content, replacing the database credentials ...