출처: https://bumcrush.tistory.com/182 [맑음때때로 여름]
C:\Users\bit>node -v
v14.16.0

C:\Users\bit>cd documents

C:\Users\bit\Documents>mkdir boiler-plate

C:\Users\bit\Documents>cd boiler-plate

C:\Users\bit\Documents\boiler-plate>npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (boiler-plate)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to C:\Users\bit\Documents\boiler-plate\package.json:

{
  "name": "boiler-plate",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}


Is this OK? (yes)

expressjs.com/en/starter/hello-world.html

 

 

 

Express "Hello World" example

Hello world example Embedded below is essentially the simplest Express app you can create. It is a single file app — not what you’d get if you use the Express generator, which creates the scaffolding for a full app with numerous JavaScript files, Jade

expressjs.com

const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => {  res.send('Hello World!')})

app.listen(port, () => {  console.log(`Example app listening at http://localhost:${port}`)})

 

 

 

 

+ Recent posts