HI friends ... this might be a silly question but its hard for a beginner like me . I am trying to lean about webservices I have created a sample program in express that outputs a JSON
var http=require('http');
var express=require('express');
var app=express();
app.configure(function(){
app.set('port',process.env.PORT || 5000);
app.use(express.bodyParser());
});
app.get("/",function(req,res){
res.json({Message:"HELLO_WORLD"});
});
http.createServer(app).listen(app.get('port'),function(){
console.log("Server is running at port:" + app.get('port'));
});
- I am able to execute this on my aws server when i run on it
- how to access it from another desktop(ex:my home-PC)
when i give localhost:5000 it dosen't work. According to my knowledge the solution is WEBSERVICES .
how to create it .... what additional lines of code i need to add for this existing code. or if i need to create any other configuration file .... how to do it? . Thanks in advance