코딩 쏙쏙

2. router 본문

[Dev_Study]

2. router

두두만두 2023. 3. 27. 16:20

router란? 서로 다른 네트워크들을 연결해주는 장치

router 폴더의 index.js의 코드들을 보시면

//routes/commentRouter.js

const express = require("express");
const commentController = require("../controllers/commentController");

const router = express.Router();

router.post("/product", commentController.product);

module.exports = {
  router,
};

내가 가지고 있는 usersRouter, postsRouter, likerRouter, commentRouter 각자의 위치의 데이터로 보내준다.

 

※ 계속 수정될 예정 입니다.  

'[Dev_Study]' 카테고리의 다른 글

Session & Cookie 특징, 차이점  (0) 2023.04.02
인증(Authentication) & 인가, Session & Cookie  (0) 2023.04.02
개발 공부(2)_암호화의 종류  (0) 2023.04.02
1. Layered  (0) 2023.03.27
개발공부(1)_MySQL 개념  (0) 2023.03.27