Skip to content

jaredmcdonald/nw-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nw-dashboard

configuration

npm install

get a free weather underground api key, set up a todo server and set up config.json:

{
  "ALERT_SERVER_HOST" : "1.2.3.4",
  "ALERT_SERVER_PORT" : 3000,
  "WUNDERGROUND_API_KEY" : "<your api key here>",
  "TODO_SERVER_URL" : "https://path/to/your-todo-server"
}

then

npm start

alert server

nw-dashboard has a built-in server for receiving, retrieving and deleting (very rudimentary) alert messages. server starts up automatically at http://<host>:<port>, where port is the value specified in config.json as "ALERT_SERVER_PORT" (defaults to 8080) and host is "ALERT_SERVER_HOST" (default is localhost, but I've had problems seeing this elsewhere on a network and ended up specifying a network IP here to make it visible). note that for now there is no persistence for alerts--they're just stored in-memory as an array

routes:

POST /alert

body must contain the following two fields:

{
  "title" : "alert title",
  "description" : "this is a longer description of the alert"
}

otherwise the server will reject them with a 400 Bad Request. if accepted, server will send 201 Created with the url of the resource (/alerts/<id>)

DELETE /alert/<id>

deletes the alert with the specified id and return 204 No Content if there is an alert with that id; 404 Not Found otherwise

GET /alert/<id>

returns the alert with the specified id (200 OK) if there is an alert with that id; 404 Not Found otherwise

PATCH alert/<id>

updates fields of the alert with the specified id with values in the body of the request (204 No Content); fields that are not "title" and "description" are ignored. if alert with specified id isn't found, 404

GET /alert/all

returns all alerts (200 OK)

About

test dashboard using node-webkit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published