Created
February 8, 2015 06:36
-
-
Save houhr/aec37d5e8b948baeaad9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var servi = require('servi'); | |
var app = new servi(false); // servi instance | |
function sendData(request) { | |
// print out the fact that a client HTTP request came in to the server: | |
console.log("Got a client request, sending them the data."); | |
// respond to the client request with the latest serial string: | |
request.respond(latestData); | |
} | |
app.port(8080); // port number to run the server on | |
app.serveFiles("public"); // serve static HTML from public folder | |
app.route('/data', sendData); // route requests for /data to sendData() | |
app.start(); // start the server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment