Doapper Doapper - 3 months ago 9x
Node.js Question

Node.js server with http get json

I want to create a simple Node.js server to do the following :

With my application I just do the command

to get the json file data stored on my server.

Could please help me with a tutorial? Any help would be appreciated!


This is very simple example of node.js server:

var app = require('./app');
var http = require('http');
var server = http.createServer(app);

server.listen(8080, function() {
    console.log("listening to:");

// routing
app.get('/', function (req, res) {
    res.sendfile(__dirname + '/index.html');

there is a nice tutorial here and here ... you can use npm to install node.js and all the packages that you need for it. hope it helps.