Skip to content

Instantly share code, notes, and snippets.

@romach
Last active October 11, 2020 19:34
Show Gist options
  • Save romach/b05b6dd73091608525fdeed45c17decf to your computer and use it in GitHub Desktop.
Save romach/b05b6dd73091608525fdeed45c17decf to your computer and use it in GitHub Desktop.
Create Express application
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}`)
})
{
"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