Framework 2

[JavaScript] WebSocket vs Socket IO

Socket IO ์‹ค์‹œ๊ฐ„, ์–‘๋ฐฉํ–ฅ, event ๊ธฐ๋ฐ˜์˜ ํ†ต์‹ ์„ ํ•˜๋Š” framework webSocket์€ ์œ„์˜ ํ†ต์‹ ์„ ์ œ๊ณตํ•˜๋Š” ์—ฌ๋Ÿฌ ๋ฐฉ๋ฒ• ์ค‘ ํ•˜๋‚˜ Socket IO๋Š” webSocket์˜ ๋ถ€๊ฐ€๊ธฐ๋Šฅ (X) Socket IO๋Š” ๊ฐ€๋” webSocket์„ ์ด์šฉ (O) ๋งŒ์•ฝ webSocket ์ด์šฉ์ด ๋ถˆ๊ฐ€๋Šฅํ•˜๋ฉด, Socket IO๋Š” ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์„ ์ด์šฉํ•ด์„œ ๊ณ„์† ์ž‘๋™ ์ž๋™ ์žฌ์—ฐ๊ฒฐ ์ง€์›, ์—ฐ๊ฒฐ ๋Š๊น€ ํ™•์ธ, ๋ฐ”์ด๋„ˆ๋ฆฌ ์ง€์› ํƒ„๋ ฅ์„ฑ, ์‹ ๋ขฐ์„ฑ 1. get socket server WebSocket //server.js const httpServer = http.createServer(app); const wsServer = new ws. WebSocketServer({httpServer}); Socket IO ์œ ์ €์—๊ฒŒ URL ์ œ๊ณต..

JavaScript 2024.03.29

[Next.js] Library vs Framework

Library (ex. React) ์ฝ”๋“œ ๋‚ด์—์„œ ์œ ์ €์˜ ํ•„์š”์— ์˜ํ•ด ์ด์šฉ, ํ™œ์šฉํ•˜๋Š” ๊ฒƒ ex. ๊ฐ์ฒด ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ..etc => ๊ตฌ์กฐ์— ๊ด€ํ•œ ๋ชจ๋“  ๊ฒฐ์ •์€ ์œ ์ €๊ฐ€ ๋‚ด๋ฆฐ๋‹ค. React : UI ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ build ํ•˜๋Š”๋ฐ ์‚ฌ์šฉํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ Framework (ex. Next.js) ํ”„๋ ˆ์ž„์›Œํฌ๊ฐ€ ๋‚˜์˜ ์ฝ”๋“œ๋ฅผ ํ™œ์šฉํ•œ๋‹ค => ์œ ์ €์˜ ์ฃผ๋„๊ถŒ X ์—ฌ๋Ÿฌ ๊ฒฐ์ •์„ ์œ ์ € ๋Œ€์‹ ํ•ด์ฃผ๊ณ , ์ž๋™ํ™” ์‹œํ‚จ๋‹ค ์œ ์ €๊ฐ€ ํ”„๋ ˆ์ž„์›Œํฌ์˜ ๊ทœ์น™์„ ์ง€์ผœ์•ผํ•œ๋‹ค.

Next.js 2024.03.15