Notice
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 리엑트를 다루는 기술
- 유틸리티타입은 공식문서 자주 보자
- 생코님Redux
- 출처 : 자바스크립트 딥다이브
- 에릭노이먼
- 에릭 노먼드
- 쏙쏙 들어오는 함수형 코딩
- 출처 : 한입크기로 잘라먹는 타입스크립트
- 출처 : 코딩앙마
- 고등애플
- 쏙쏙 들어오는 함수형코딩
- 오종택개발자님
- 로버트 C마틴
- 쏙속 들어오는 함수형코딩
- 함수형 코딩
- 출처 : https://www.boostcourse.org/
- 클린코드다시읽기
- 쏙쏙들어오는함수형코딩
- 에릭 노이먼
- 흥달쌤
- 이웅모
- https://product.kyobobook.co.kr/detail/S000001952246
- 나는 flux좋아...
- 큰돌의 CS책
- 갈길이 멀구나
- 출처 : 코딩애플
- 출처는 코딩앙마
- 자바스크립트 딥다이브
- 김영한쌤
- 출처는 코딩애플
Archives
- Today
- Total
흰둥씨의 개발장
[오늘의 node.js & npm] node 설정 본문
1. 프로젝트 폴더 생성
2. 내부에 react, node 폴더 생성
Express 서버 세팅
node 폴더
// package.json 생성. -y는 모든 설정을 기본으로
npm init -y
// express설치
npm i express
node > index.js
웹서버 구동을 5000번 포트로 응답받도록 설정 (맥은 5500으로 지정)
const express = require('express');
const app = express();
const port = 5000;
app.get('/', (req, res) => {
res.send('Hello World2');
})
app.listen(port, () => {
console.log(`Server app listening on port ${port}`);
})
node index.js
node > package.json
node index.js로 시작하는 대신 npm start 명령어로 시작되게 변경
{
"name": "node",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2"
}
}
웹서버 시작(서버 개발내용이 변경될 때마다 재실행 필요, 어디 이름 하나 고치면 서버 띄운거 종료하고 다시 시작하고 해야 결과확인가능)
npm start
서버 변경점 인지해서 자동 실행되게 설정하려면 노드몬을 깔아보자~
npm i nodemon --save
이후에 자동 실행되게 하려면 노드몬으로 프로젝트를 돌리면됨
node <프로젝트경로>//이렇게 시작했다면,
nodemon <프로젝트경로>//요렇게 시작하면
//내가 개발하면서 변경된 사항을 터미널에서 계속 구동해주지 않아도
//브라우저 새로고침만 하면 변경된거 확인가능
package.json
{
"name": "node",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2",
"nodemon": "^2.0.20"
}
}
'[오늘의 공부] > Node.js & package manager' 카테고리의 다른 글
[오늘의 node.js] 관계형DB(mysql...)와 비관계형DB(mongoDB) (0) | 2023.05.25 |
---|---|
[mac OS] mongoDB설치방법 & 설치 안될때 (0) | 2023.05.24 |
[오늘의 node.js] mongoose+mongoDB+express쓰기 / proxy 설정하기 (0) | 2023.03.05 |
[오늘의 node.js & npm] React를 Node 웹 서버를 통해 출력하기 (0) | 2023.03.05 |
[오늘의 node.js & npm] node js 설치 및 삭제 & yarn (0) | 2023.03.05 |