Skip to content

Files

Latest commit

789c787 · Jun 24, 2017

History

History
This branch is up to date with lucj/IoT-demo-project:master.

nodejs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 12, 2017
Jun 24, 2017
Mar 12, 2017
Mar 12, 2017
Mar 12, 2017
Mar 12, 2017

In this implementation several files are defined

  • package.json that handles all the dependencies
  • app.js that defines the expressjs web server
  • index.js that run the server

On top of those, the file test/functional.js defines a simple test that starts the API, send data and verify the returned HTTP Status Code is 201.

Starting the API

npm start

Running the test

npm test

> [email protected] test /Users/luc/IoT-demo-project/step1/nodejs
> mocha test/functional.js

  Creation
info: server listening on port 3000
info:  ts=2017-03-11T15:00:53Z, type=temp, value=34, sensor_id=123
    ✓ should create dummy data (45ms)

  1 passing (58ms)