leebom
[유투브 클론] #5 NODEJS - using Babel 본문
Babel이란?
가장 최신의 코드를 표준 코드(무난하게 사용되고 있는 코드)로 변환시켜줌
Babel · The compiler for next generation JavaScript
The compiler for next generation JavaScript
babeljs.io
ES6(arrow function)
// ex)
// function handleProfile(req, res) {
// res.send('your are on my profile')
const handleLisening = () => console.log(`Listening on: http://localhost:${PORT}`); //arrow function
const handleHome = (req, res) => res.send('hello from my cccc ');
const handleProfile = (req, res) => res.send('your are on my profile');
nodemon
소스 수정시 자동으로 재시작해줌
nodemon
Simple monitor script for use during development of a node.js app.
www.npmjs.com
{
"name": "wetube",
"version": "1.0.0",
"description": "Cloning Youtube with Vanills and NodeJS",
"author": "lee bom",
"license": "ISC",
"dependencies": {
"@babel/core": "^7.12.3",
"@babel/node": "^7.12.6",
"@babel/preset-env": "^7.12.1",
"express": "^4.17.1"
},
"scripts": {
"start": "nodemon --exec babel-node index.js"
},
"devDependencies": {
"nodemon": "^2.0.6"
}
}
/package.json
leebom21/Wetube
Cloning Youtube with Vanills and NodeJS. Contribute to leebom21/Wetube development by creating an account on GitHub.
github.com
'스터디 > 개인스터디(유투브 드림코딩 by엘리)(주5회)' 카테고리의 다른 글
#6 NODEJS - Routing (0) | 2020.11.23 |
---|---|
[유투브 클론] #6 NODEJS - middleware (0) | 2020.11.19 |
[유투브 클론] #4 NODEJS - express (1) | 2020.11.11 |
[유투브 클론] #3 NODEJS 서버만들기 (0) | 2020.11.11 |
[유투브 클론] #2 NODEJS 서버만들기 (0) | 2020.11.10 |
Comments