- Smart Garden Project
- Install NodeJS
## Move to server folder
$ cd server
## Install dependency
$ npm install
## Start a server
$ node index.js
## Open at localhost:3000 on Google Chrome
- POST /api/sensor
- Header: content-type: application/json
- Body JSON with a following format
{
"temperature": 20,
"moisture": 30,
"light": 40
}
curl --request POST \
--url http://localhost:3000/api/sensor \
--header 'content-type: application/json' \
--data '{
"temperature": 20.232,
"moisture": 20.123213,
"light": 50
}'
- Delete server/token.json
- Run
node index.js
- Copy a link on the terminal and start authorizing
- Follow the guideline
- Commit and push