Feature #607

Migrate www to NodeJS

Added by Hammel over 1 year ago. Updated about 1 year ago.

Status:ClosedStart date:19 Feb 2018
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:Monitor
Target version:002 - MVP
Severity:03 - Medium

Description

The PoC was written in PHP based on the PiBox Web UI code. This worked, but it's a poor implementation going forward. Implementation on top of a nodejs with Restify will make it easier to implement a real REST API.

Create a stub service for both http and https based on the REST APIs implemented in NodeJS with Restify. Import as few 3rd party modules as possible!!

Here's an article on testing REST APIs with curl:
http://www.codingpedia.org/ama/how-to-test-a-rest-api-from-command-line-with-curl/

Associated revisions

Revision 6450f3f1
Added by Hammel over 1 year ago

RM #607: Import of new NodeJS-based server stubbed for the REST APIs, including basic logging and unit tests.

Revision 6450f3f1
Added by Hammel over 1 year ago

RM #607: Import of new NodeJS-based server stubbed for the REST APIs, including basic logging and unit tests.

Revision 69565f9f
Added by Hammel over 1 year ago

RM #607: Various updates before first test with imrest.

Revision 69565f9f
Added by Hammel over 1 year ago

RM #607: Various updates before first test with imrest.

Revision ed61ab0e
Added by Hammel over 1 year ago

RM #607: Add runserver.sh to package so it can be used to run web server for initial configuration of networks. Run that script at boot time if the pair button is pressed.

Revision ed61ab0e
Added by Hammel over 1 year ago

RM #607: Add runserver.sh to package so it can be used to run web server for initial configuration of networks. Run that script at boot time if the pair button is pressed.

Revision e7d662b8
Added by Hammel over 1 year ago

RM #607: Put runserver.sh in the background when run at boot time.

Revision e7d662b8
Added by Hammel over 1 year ago

RM #607: Put runserver.sh in the background when run at boot time.

Revision 8329658c
Added by Hammel over 1 year ago

RM #607: Check for gpio stamp file instead of testing the pins manually.

Revision 8329658c
Added by Hammel over 1 year ago

RM #607: Check for gpio stamp file instead of testing the pins manually.

Revision ae4479ac
Added by Hammel over 1 year ago

RM #607: Remove imnetconfig reference in favor of /etc/gpio/pair use.

Revision ae4479ac
Added by Hammel over 1 year ago

RM #607: Remove imnetconfig reference in favor of /etc/gpio/pair use.

History

#1 Updated by Hammel over 1 year ago

  • % Done changed from 0 to 30

I pushed the first stubbed services in nodejs. I'm updating the PiBox core development platform since it's been awhile since I last built it. And I'm adding nodejs to that build.

The Ironman www project now has both PHP and NodeJS versions of the server, with the latter being a little more complete. I need to finish porting what works to the new API structure in the REST server, then I can delete the old PHP server. After that I need to finish implementing the API for the monitor before moving on to the IoT and Jarvis sides.

I have a unit test framework implemented under the tests directory for testing what's there now, which is mostly just testing header handling.

#2 Updated by Hammel over 1 year ago

  • Description updated (diff)

#3 Updated by Hammel over 1 year ago

  • Severity changed from 01 - Critical to 03 - Medium

#4 Updated by Hammel about 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 30 to 100

The PHP interface is only used when in pairing mode. It is disabled when not in pairing mode.

While there is some value in porting the PHP to the NodeJS server, there is little need to rewrite this code now. It works as is and is good enough for MVP.

Closing issue.

Also available in: Atom PDF