Javascript
![[React] ๋ฆฌ์กํธ ๋ผ์ฐํฐ์ ๊ด๋ จ Hooks ์ ๋ฆฌ](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FDJJjf%2FbtrTChtybYn%2FJyb4ubItibevyIXaYt4no0%2Fimg.png)
[React] ๋ฆฌ์กํธ ๋ผ์ฐํฐ์ ๊ด๋ จ Hooks ์ ๋ฆฌ
- ๋ผ์ฐํฐ ๊ฐ๋ ์ดํด + Link ๊ฐ๋ - restful route ๊ฐ๋ ์ดํด - react hook ์ค์์ useNavigate, useParams, useSearchParams์ดํด Route๋ ๊ฒฝ๋ก๋ ๋ป์ด๋ค. ์นํ์ด์ง๋ฅผ ์ฌ๋ฌ๊ฐ ๋ง๋ค๊ณ , ์ด ๊ฐ๊ฐ์ ์นํ์ด์ง๋ฅผ ๊ฐ๊ธฐ ์ํ ๊ฒฝ๋ก๊ฐ ํ์ํ๋ค. ์ค์น ๋ช ๋ น์ด npm install react-router-dom BrowserRouter ๋ค๋ฅธ ์ฐฝ์ URL์ ๋ํ ๋ณ๊ฒฝ ์ฌํญ์ ์ถ์ ํ๋ ๋ฐ ์ฌ์ฉํ ์๋ ์๋ค import * as React from "react"; import * as ReactDOM from "react-dom"; import { BrowserRouter } from "react-router-dom"; ReactDOM.render( , root ); R..
[Node.js] (8) ๊ฐ๋ฐ ํธ์ ์ฌ๋ ค! npm start์ nodemon ์ ์ฉํ์ฌ ์ ์ฅ์ ์๋์๋ฒ ์ฌ์์ ์ค์ ํ๊ธฐ!
package.json "start":"node app.js" ๋ก ์ค์ ํด์ฃผ์ด npm start๋ง ํด๋ ์ฑ์ด ๊ตฌ๋๋จ์ ์๋ ค์ค + ์์์ js๊ฐ ๋ฌด์์ธ์ง ์๋ ค์ค ์ ์์ { "name": "node-test", "version": "1.0.0", "description": "", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start":"node app.js" }, "author": "", "license": "ISC" } "start-server":"node app.js" ์์ผ๋ก ๋ช ๋ช ํ๋ ๊ฒ์ ๊ฐ๋ฅํ๋ฐ start๋ ํน์ํ ๋ช ๋ น์ด์ด๊ณ start-server๋ ์ฌ์ฉ์ ์ ์ ๋ช ๋ น์ด์ด๋ฏ๋ก npm run ..
[Node.js] (7) Node ๋ชจ๋ ์์คํ ์ฌ์ฉ
ํฌ์คํ (6)๊น์ง ์์ฑํ๋ ํ๋ก์ ํธ๋ app.js ์์์ ์ฝ๋๊ฐ ๊ธธ๊ฒ ๋์ด๋์ด ์๋ ํ์์ด์๋ค. ๋ ธ๋์ ๋ชจ๋ ์์คํ ์ ํ์ฉํด์ requestHandler๋ฅผ ๋ง๋ค์ด๋ฌ๊ณ , app.js๋ฅผ ๊ฐ๋ณ๊ฒ ๋ฐ๊พธ์ด๋ณธ๋ค. app.js : ๋จ 4์ค! const http = require('http'); const routes = require('./routes'); const server = http.createServer(routes); server.listen(3000); routes.js : app.js์ ์ฃผ๋ ์ฃผ๋ ๋ฌ๋ ค์๋ ์๋ต, ์์ฒญ, ํ์ผ์์คํ ๋ก์ง์ ์ ๋ถ ์ฎ๊ฒจ์ฃผ์๋ค. module.exports = requestHandler; { const url = req.url; const method = req.method; ..
![[Next.js] Next.js๋ ๋ฌด์์ด๊ณ , ์ ์ฌ์ฉํ๋๊ฐ?](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F0Xu3G%2FbtrTltbs1lq%2FwFOtXYsRSESQgFK4bwXkGk%2Fimg.png)
[Next.js] Next.js๋ ๋ฌด์์ด๊ณ , ์ ์ฌ์ฉํ๋๊ฐ?
ํํ์ด์ง ๋๋ฌธ์๋ ํ๋ก๋์ ์ฉ React ํ๋ ์์ํฌ ๋ผ๊ณ ์จ์ ธ์๋ Next.js React ๊ฐ๋ฐ์์๊ฒ, NextJS์ ์ฌ์ฉ์ด ์ด๋ป๊ฒ ๋์์ด ๋๋์ง ์์๋ณด์ React๋ ์ฌ์ฉ์ ์ธํฐํ์ด์ค ๊ตฌ์ถ์ ์ํ JavaScript ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ด๋ค. ReactJS๋ ์๋ ํํฐ ํจํค์ง๋ก ํ๋ก ํธ์๋ ํ๋ก์ ํธ์ ์ถ๊ฐ๋๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ด๋ค. React๋ฅผ ์ฌ์ฉํด ์ํธ ์์ฉ์ด ๊ฐ๋ฅํ(๊ฐ๋ฐ์ ์ ์ฅ์์ ๋ณต์กํ) ์ฌ์ฉ์ ์ธํฐํ์ด์ค๋ฅผ ๋ง๋ค ์ ์๋ค. ์๋ฒ์ฌ์ด๋ ๋ ๋๋ง : ํด๋ผ์ด์ธํธ ์ธก์ด ์๋ ์๋ฒ ์ธก์ ํ์ด์ง ์์ ๋ ๋๋ง๋๋ ์ฝํ ์ธ ์ฒ๋ฆฌ๋ฅผ ์๋ฏธํจ ํด๋น ํ์ด์ง๊ฐ ์๋ฒ์์ ๋ฏธ๋ฆฌ ๋ ๋๋ง์ด ๋๋ ์ฆ, ์์ฒญ์ด ์๋ฒ๋ก ๋๋ฌํ ๋ ๋ฐ์ดํฐ ํ์นญ์ด ์๋ฒ ์ธก์์ ์ฒ๋ฆฌ๋๋ค๋ฉด ๋ชจ๋ ๋ด์ฉ์ ํฌํจํ ํ์ด์ง๊ฐ ์ฌ์ฉ์์ ๊ฒ์ ์์ง ์ฌ์ฉ์๋ค์๊ฒ ์ ๊ณต๋ ์ ์๋ค. ๊ทธ๋ฌ๋ฉด ์ฌ..
![[Postman] Rest APIs ๊ฐ๋ฐ์ ์ํ ํฌ์คํธ๋งจ ์
์](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb3iIJE%2FbtrTqEibuf6%2FmW0wKG3rl3RZNePtJ8Pm81%2Fimg.png)
[Postman] Rest APIs ๊ฐ๋ฐ์ ์ํ ํฌ์คํธ๋งจ ์ ์
Get ์์ฒญ ์ ์์ ๊ฐ์ด ์์ฑํ๋ค. ์์ฑํด๋ ๋ณ์ base๋ {{base}}
![[React + Node ๊ฐ์ด ๋๋ ค์ก๊ธฐ] (6) npm ๋ฆฌ์กํธ ๋ก๋ฉ์คํผ๋ + ์์น ๋์ ๊ธฐ๋ฐ ๋ ์จ ์ฑ ์์ฑ](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FBUzL0%2FbtrThe6gPlN%2FictGQ6ERMJsgsmPnZ2Zss1%2Fimg.png)
[React + Node ๊ฐ์ด ๋๋ ค์ก๊ธฐ] (6) npm ๋ฆฌ์กํธ ๋ก๋ฉ์คํผ๋ + ์์น ๋์ ๊ธฐ๋ฐ ๋ ์จ ์ฑ ์์ฑ
npm ๋ฆฌ์กํธ ๋ก๋ฉ์คํผ๋ https://www.npmjs.com/package/react-spinners react-spinners A collection of react loading spinners. Latest version: 0.13.7, last published: 7 days ago. Start using react-spinners in your project by running `npm i react-spinners`. There are 714 other projects in the npm registry using react-spinners. www.npmjs.com npm install --save react-spinners Example import { useState, CSSPrope..
[Next.js] ํ๋ก์ ํธ ๋ง๋ค์ด์ ์คํํด๋ณด๊ธฐ
npm init npm i next@9 npm i react react-dom package.json์ ์๋์ ๊ฐ์ด ๋ณ๊ฒฝ { "name": "nodebird", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "dev": "next", "build": "next build" }, "author": "", "license": "ISC", "dependencies": { "next": "^9.5.5", "react": "^16.14.0", "react-dom": "^16.14.0" } } ํด๋ pages ๋ง๋ค์ด์ฃผ๊ณ ๊ทธ ์์ ํ์ผ index.js ๋ง๋ค๊ธฐ index.js const Home = () = { return( Hello ..
![[Node.js] (6) Single Thread, Event Loop & Blocking Code](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fy3eie%2FbtrTtBmiu7Q%2FRunPLsCwW8LBcWIg86gfs0%2Fimg.png)
[Node.js] (6) Single Thread, Event Loop & Blocking Code
์ฑ๊ธ์ค๋ ๋ (Single JavaScript Thread ) NodeJs๋ ํ๋์ JavaScript ์ค๋ ๋๋ง ์ฌ์ฉํ๋ค. ์ค๋ ๋๋ ์ฝ๊ฒ ๋งํด ์ด์ ์ฒด์ ์์์ ํ๋ก์ธ์ค๋ก ํ๋์ ์ค๋ ๋๋ง ์ฌ์ฉํ๋ค๋ฉด ์ด๋ป๊ฒ ์ฌ๋ฌ ์์ฒญ์ ๋ค๋ฃจ๋์ง์ ๊ถ๊ธํด์ง๋ค. ๊ฐ ์์ฒญ๋ง๋ค ์ค๋ ๋๋ฅผ ์ง์ ํ ์ ์์ผ๋, ๊ฒฐ๊ตญ ๋ชจ๋ ํ๋์ ์ค๋ ๋์์ ์คํ๋ ๊ฒ. ์ด๋ฒคํธ๋ฃจํ ( Event Loop ) ์ด๋ฒคํธ ๋ฃจํ๋ Node.js ๊ฐ ์์ํ๋ฉด ํ๋ก๊ทธ๋จ์ ์ํด ์๋์ผ๋ก ์์๋๋ค. ์ด๋ฒคํธ ๋ฃจํ๋ ์ด๋ฒคํธ ์ฝ๋ฐฑ์ ๋ค๋ฃฌ๋ค. ํน์ ์ด๋ฒคํธ๊ฐ ์ผ์ด๋ฌ์ ๋ ๋ฐ๋ก ์ด๋ฒคํธ ๋ฃจํ๊ฐ ํด๋น ์ฝ๋๋ฅผ ์คํํ๋ ๊ฒ์ด๋ค. ๋ชจ๋ ์ฝ๋ฐฑ์ ํ์ ํ๊ณ ์์ด์ ์ฝ๋๋ฅผ ์คํํ๋ค. ๋นจ๋ฆฌ ๋๋ผ ์ ์๋ ์ฝ๋๋ฅผ ํฌํจํ ์ฝ๋ฐฑ๋ง์ ๋ค๋ฃฌ๋ค. ๋ญ๋๋ญ๋ํด๋ ์๋ณธ ๋ํ๋จผํธ๊ฐ ์ต๊ณ ์๋๊ฒ ๋๊ฐ : https://n..
![[React + Node ๊ฐ์ด ๋๋ ค์ก๊ธฐ] (5) react one-way data flow + ์์น ๋์ ๊ธฐ๋ฐ ๋ ์จ ์ฑ ๊ณ์ making](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FomP5K%2FbtrTfT8ddko%2FGXhgtWJPI1Vj5JYxIjcurK%2Fimg.png)
[React + Node ๊ฐ์ด ๋๋ ค์ก๊ธฐ] (5) react one-way data flow + ์์น ๋์ ๊ธฐ๋ฐ ๋ ์จ ์ฑ ๊ณ์ making
ํฌ์คํ ์์น ๋์๊ธฐ๋ฐ ๋ ์จ์ฑ(4)์ ์ด์ ๋ง๋ฌด๋ฆฌ ์์ App.js๊ฐ ๋ชจ๋ ๋ก์ง์ ๋ค ๊ฐ๊ณ ์๊ณ , ์ปดํฌ๋ํธ์ ๋ณด๋ด์ฃผ๋ ์์ผ๋ก ์์ ์ ์งํํด๋ณด๋๋ก ํ๋ค. react one-way data flow ๋๋ฌธ์ด๋ค. ์ปดํฌ๋ํธ ํ์ ๋ผ๋ฆฌ ๋ฐ์ดํฐ๋ฅผ ์ฃผ๊ณ ๋ฐ๊ธฐ๊ฐ ์๋นํ ์ด๋ ต๋ค. ๋ฆฌ์กํธ ํน์ง one-way reactive data flow https://tkssharma.gitbook.io/react-training/day-01/react-js-3-principles/one-way-data- The foundation of understanding component relationships in React and parent component hierarchyโฆ Props stands for properties. It is ..
![[React + Node ๊ฐ์ด ๋๋ ค์ก๊ธฐ] (4) ์์น ๋์ ๊ธฐ๋ฐ ๋ ์จ ์ฑ (api ์ฐ๊ฒฐ ๊ธฐ์ด์์
, UI์์
)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FFbRLz%2FbtrS6hUZVaN%2F8BhQr3cvHSBRk4MSutEj71%2Fimg.png)
[React + Node ๊ฐ์ด ๋๋ ค์ก๊ธฐ] (4) ์์น ๋์ ๊ธฐ๋ฐ ๋ ์จ ์ฑ (api ์ฐ๊ฒฐ ๊ธฐ์ด์์ , UI์์ )
1. ๊ธฐ๋ฅ ๋ช ์ธ์ //1. ์ฑ์ด ์คํ๋์๋ง์ ํ์ฌ ์์น ๊ธฐ๋ฐ์ ๋ ์จ๊ฐ ๋ณด์ธ๋ค. //2. ๋ ์จ ์ ๋ณด์๋ ๋์, ์ญ์จ, ํ์จ ๋ ์จ ์ํ //3. 5๊ฐ์ ๋ฒํผ์ด ์๋ค (1๊ฐ๋ ํ์ฌ ์์น, 4๊ฐ๋ ๋ค๋ฅธ ๋์) //4. ๋ก๋ฉ ์คํผ๋ ๊ธฐ๋ฅ ์ถ๊ฐ 2. weather api https://openweathermap.org/api Weather API - OpenWeatherMap Please, sign up to use our fast and easy-to-work weather APIs. As a start to use OpenWeather products, we recommend our One Call API 3.0. For more functionality, please consider our products, ..