// Node.js Routing with HTTP Method
const http = require('http');
const port = 4000
const app =http.createServer((request,response) =>{
	if(request.url == '/items' && request.method == 'GET'){

		response.writeHead(200,{'Content-Type':'text/plain'});
		response.end('Data retrieve from the datebase');
	}

	if(request.url == '/items' && request.method == 'POST'){

		response.writeHead(200,{'Content-Type':'text/plain'});
		response.end('Data to be sent to the datebase');
	}
});
// or const http =require.createServer(function(request,response){
// });
app.listen (port,() => console.log(`Server running at localhost:${port}`));

