You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Blaine Motsinger b36bdb2f94 removed default api key pass from config 3 years ago
config removed default api key pass from config 3 years ago
systemd added systemd file 3 years ago
.gitignore refined logic to read the pin and error 3 years ago
README.txt shortened hostname in systemctl output 3 years ago
package.json corrected node-dht-sensor version 3 years ago
weather-api.js removed default api key pass from config 3 years ago

README.txt

# NAME

weather-api - simple API in nodejs

# DESCRIPTION

This project provides a simple API, written in nodejs, which serves temperature and humidity data from the Raspberry Pi.

Supported sensors are the DHT11 or DHT22 (AM2302) read using the bcm2835 C library.

# SYNOPSIS

server ~/weather-api $ nodejs weather-api.js
[06152018-233738] [info] weather-api - version 0.1.11
[06152018-233738] [info] environment: development
[06152018-233738] [info] serving: 0.0.0.0:3000
[06152018-233948] 10.0.0.103 GET /weather 200

laptop ~ $ curl -X GET -H 'API_KEY: 1234567890qwerty' server:3000/weather
{
"temperature" : 85,
"humidity" : 65
}

# ENDPOINTS

The API is served over port 3000 and bound to all addresses by default, but can be configured to a specific address or port (see the 'CONFIGURATION' section below).

## /weather

### METHODS

#### GET

This API is a read-only resource; GET is the only allowed method.

All other methods requested to the API will return exceptio