Last active
June 23, 2019 23:42
-
-
Save J3698/63b0e0f448bd20aeef6eb062aba59901 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const express = require('express'); // import express | |
const app = express(); | |
/* | |
* A deployment service might set a correct PORT | |
* to use, if no port is set 5000 will probably | |
* be free for use. | |
*/ | |
const port = process.env.PORT || 5000; | |
// output whether the app runs or errors | |
app.listen(port, function (err) { | |
if (err) | |
console.log(err); | |
else | |
console.log("App running"); | |
}); | |
// create our first route | |
app.get('/greet', (req, res) => { | |
res.send("hi"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment