Notice
Recent Posts
Recent Comments
Link
«   2026/02   »
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
Archives
Today
Total
관리 메뉴

사고쳤어요

[Node.js] 유튜브 서비스 - 채널 전체 조회(GET) 본문

웹 풀스택

[Node.js] 유튜브 서비스 - 채널 전체 조회(GET)

kevinmj12 2025. 2. 20. 17:37

채널 전체 조회

.get((req, res) => {
    var channels = [];
    channelDb.forEach((val) => {
      channels.push(val);
    });

    if (channels.length) {
      res.json(channels);
    } else {
      res.status(404).json({
        message: "조회할 채널이 없습니다.",
      });
    }
  })