Created
April 10, 2018 05:02
-
-
Save naveenrobo/65d2ecced51766b895e5ca1287fc460a 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 express = require('express'); | |
var app = express(); | |
app.get('/', function (req, res) { | |
res.send('Hello World'); | |
}) | |
var server = app.listen(8081, function () { | |
var host = server.address().address | |
var port = server.address().port | |
console.log(`Example app listening at ${host}:${port}`) | |
}) | |
app.post("/date",function(req,res){ | |
console.log(req); | |
res.send(new Date().toLocaleString()); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment