웹 어플리케이션
요약
$ npm init
$ npm i fastify --save
실습시작
- 처음에 폴더를 하나 만들고 그 이름을 Web이라고 명명하겠다.
- 예시 (Dockerfile 부분은 이전 실습이니 무시할 것)
- npm을 사용해줄려면 초기에 npm init을 해줘야 한다.
(base) glory@Gloryui-MacBookPro Web % 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: (web)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /Users/glory/Desktop/(GITHUB)/Web/package.json:
{
"name": "web",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \\"Error: no test specified\\" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this OK? (yes) yes
╭────────────────────────────────────────────────────────────────╮
│ │
│ New patch version of npm available! 6.14.5 → 6.14.9 │
│ Changelog: <https://github.com/npm/cli/releases/tag/v6.14.9> │
│ Run npm install -g npm to update! │
│ │
╰────────────────────────────────────────────────────────────────╯
(base) glory@Gloryui-MacBookPro Web %
- 그 다음에는 install 명령어인 npm i fastify --save 을 해준다.
- 실행화면
- 여기까지 되었으면 폴더에 app.js 파일을 넣는다.
- 소스코드