I need to create a simple rest based webservice in node.js I already know only how to consume the already exposed ones.I used http module for that.Any suggestion on how to create a webservice will be much helpful
You can use Expressjs, it's the most common web framework to make REST Api. Check this stackoverflow question which provides a lot of good resources. Have a look at this tutorial too.
If you need something more evolved I recommend you CompoundJS which will help you to give a structure to your code.
Hey heres something that i tried its really simple.Below is the code
var express = require("express");
var app = express();
var data="<Bank><rows>10</rows></Bank>"
console.log(data);
app.get('/Dynamic', function(req, response) {
response.contentType('application/xml');
console.log('listening');
response.send(data);
});
console.log('server will be listening on: 1360' );
app.listen(1360);
Hope this helps .