성장에 목마른 코린이

[Node.js] 프로젝트 시작 기본 세팅 본문

Javascript/Node.js

[Node.js] 프로젝트 시작 기본 세팅

성장하는 코린이 2022. 11. 23. 09:47
728x90

1. node 설치 확인

node -v

2. npm init

package.json 추가됨 

npm init

3. express 설치

node_modules 폴더와 package-lock.json 파일 추가됨

npm install --save express

4. 초기 파일 생성

index.js

const express = require('express');
const app = express();

const port = 5000;

app.get('/', function(req, res){
    res.send('프로젝트 이름');
})

app.listen(port, () => console.log(`listening to ${port}`));

5. nodemon 설치 및 적용

"scripts": {
    "start": "nodemon --inspect index.js"
 }

6. .gitignore 생성

node_modules
dist/*
*.log
.DS_Store
.env

MariaDB 세팅 한다면 아래 제 블로그 링크 클릭

 

[DB] MariaDB 설치, 세팅, 접속 (Mac)

1. MariaDB 설치 (Mac) brew install mariadb mariadb 실행 및 중지 실행 : brew services start mariadb 중지 : brew services stop mariadb mariadb를 동작하는지 확인 brew services list 2. MariaDB root 계정 생성 Mysql과 마찬가지로 Mari

mhp4718.tistory.com

 

Comments