index.js
const express = require('express')
const app = express()
const port = 5000
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
})
pacakage.json
{
"name": "boiler-plate",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "jeongwon",
"license": "ISC",
"dependencies": {
"express": "^4.17.2"
}
}
1) 터미널에 npm run start
치기

2) localhost:5000
