Last active
October 11, 2020 19:34
-
-
Save romach/b05b6dd73091608525fdeed45c17decf to your computer and use it in GitHub Desktop.
Create Express application
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') | |
// instantiate express application | |
const app = express() | |
// create simple route | |
app.get('/', (req, res) => { | |
res.send('Hello world!') | |
}) | |
// start application | |
const PORT = 8080 | |
app.listen(PORT, () => { | |
console.log(`Listening on port ${PORT}`) | |
}) |
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
{ | |
"name": "express-example", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"express": "^4.17.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment