Giter Club home page Giter Club logo

moviesite_with_nodejs's Introduction

๋ฉด์ ‘ ๋๋‚ฌ์œผ๋‹ˆ ๋‹ค์‹œ react!!! ๋…ธํŠธ๋ถ ssh key ๋“ฑ๋ก ์™„๋ฃŒ (2020.12.15) ๋ฐœํ‘œ ์–ธ์ œ๋‚˜๋Š”๊ฑฐ์ง€..

๊ฐ•์˜๋งํฌ

๋”ฐ๋ผํ•˜๋ฉฐ ๋ฐฐ์šฐ๋Š” ๋…ธ๋“œ ๋ฆฌ์•กํŠธ ์˜ํ™”์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ - John Ahn

์ง„ํ–‰๊ธฐ๊ฐ„

2020.12.13 AM 1:00 (Sunday) ~

์ง„ํ–‰๊ณผ์ •

ISSUE!!

1

SSH ํ‚ค๋ฅผ ๋“ฑ๋กํ–ˆ์Œ์—๋„ pushํ•  ๋•Œ ์•„์ด๋””์™€ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์š”๊ตฌํ•˜๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๋Š”๋ฐ, ์ด๊ฒƒ์€ ํ„ฐ๋ฏธ๋„์ด ๊นƒ ์ต์Šคํ…์…˜์ด ํ™œ์„ฑํ™”๋˜๊ธฐ ์ „์— ์ผœ์กŒ์—ˆ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. (When terminal comes up before the Git extension activated) ๊ป๋‹ค ์ผœ๋‹ˆ ํ•ด๊ฒฐ๋˜์—ˆ๋‹ค.

React!!

const = constant. ๋‹ค๋ฅธ ํŒŒ์ผ์—์„œ๋„ ํ•ด๋‹น ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ๋„๋ก

Setting

npm install์„ ํ•˜๋‹ˆ ์—ญ์‹œ๋‚˜ ์—„์ฒญ๋‚œ ์—๋Ÿฌ๊ฐ€. ๊ทธ ํ•ด๊ฒฐ์„ ์œ„ํ•œ ๊ณผ์ •.

antd doesn't export Icon package. Change to ant-design.

Icon์„ ๊ฐ€์ ธ์˜ค๋Š” ๋ถ€๋ถ„์ด ๋ฐ”๋€Œ์—ˆ๋‹ค. ์ˆ˜์ •ํ•ด ์ค€๋‹ค.

client/
npm install @ant-design/icons --save-dev

์—ฌ๊ธฐ๊นŒ์ง€ ํ•˜๋‹ˆ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ์žˆ๋‹ค๋Š” Warning๋งŒ ๋‚จ์€ ์ƒํƒœ.

npm install

Install npm in root, client directory. It installs dependencies in package.json.

moviedb api

๋งํฌ : https://www.themoviedb.org/ Setting - API์—์„œ ํ‚ค ๋ฐ›์•„ ์˜ค๋Š”๋ฐ, ์‚ฌ์šฉํ•˜๋Š” ์ด์œ ์— API๋ฅผ ๋‹จ๋…์œผ๋กœ ์จ ๋„ฃ์–ด์•ผ elaborate(์ •๊ตํ•œ)ํ•˜๋‹ค๊ณ  ํŒ๋‹จํ•œ๋‹ค. ํ—ˆํ—ˆ

movie api v3 : 234c446afa7c9156e6c9a101b724f5ae

๋žœ๋”ฉํŽ˜์ด์ง€ ๋งŒ๋“ค๊ธฐ

๋ฉ”์ธ ์˜ํ™” ์ด๋ฏธ์ง€ ๊ฐ€์ ธ์˜ค๊ธฐ

API๋กœ ํ˜ธ์ถœํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๊ตฌ์„ฑํ•˜๋Š” ๋‹จ๊ณ„์— MainImage๋ฅผ ์ปดํฌ๋„ŒํŠธ๋กœ ๋ฟŒ๋ฆฌ๊ธฐ๋งŒ ํ•˜๋ฉด ๊ฐ€์ ธ์˜ค๊ธฐ๋„ ์ „์— ๋ Œ๋”๋งํ•˜๋ฉด์„œ, ์ •๋ณด๊ฐ€ nullํ•˜๋‹ค๋Š” ์—๋Ÿฌ๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค. ๋”ฐ๋ผ์„œ &&๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๊ฐ€์ ธ์™€์•ผ ํ•œ๋‹ค.

&&๋ฅผ ์‚ฌ์šฉํ•จ์œผ๋กœ์จ MainMovieImage๋ฅผ ๊ฐ€์ ธ์™”์„ ๊ฒฝ์šฐ์—๋งŒ ๋ Œ๋”๋งํ•˜๋ผ๋Š” ์˜๋ฏธ๊ฐ€ ๋˜๊ณ , ์—๋Ÿฌ ์—†์ด ์ •์ƒ์ ์œผ๋กœ ์ถœ๋ ฅํ•  ์ˆ˜ ์žˆ๋‹ค.

๊ทธ๋ฆฌ๋“œ ๋งŒ๋“ค๊ธฐ

commons ํด๋”๋ฅผ ํ•˜๋‚˜ ์ƒ์„ฑํ•œ๋‹ค.

useState์˜ ์‚ฌ์šฉ (๋‚˜์ค‘์— ๋ณด๊ธฐ)

response ์•ž์— ...๋ฅผ ๋ถ™์—ฌ์•ผ results(array type)๋ฅผ ์ •์ƒ์ ์œผ๋กœ ์ถœ๋ ฅํ•˜๋Š” ๋ชจ์Šต์„ ๋ณด์˜€๋‹ค. ๊ฐ•์˜์—์„œ๋Š” ...๋ฅผ ๋บ์ง€๋งŒ ๊ฐ•์‚ฌ์˜ ์ฝ”๋“œ์—๋Š” ์žˆ๊ธธ๋ž˜ ์จ ๋ดค๋”๋‹ˆ ๊ทธ์ œ์•ผ ๋œ๋‹ค. ๋ญ๊ฐ€ ๋‹ค๋ฅธ ๊ฒƒ์ผ๊นŒ?

๋”๋ณด๊ธฐ ๋ฒ„ํŠผ ๋งŒ๋“ค๊ธฐ

...response.results๋กœ ๋‘๋ฉด, ๋‚ด์šฉ์„ ๋” ๋„ฃ์„ ๊ฒฝ์šฐ ๋ฎ์–ด์”Œ์šด๋‹ค(overwrite). ์ถ”๊ฐ€๋ฅผ ํ•˜๊ฒŒ ํ•˜๋ ค๋ฉด ์›๋ž˜ ์žˆ๋˜ State๋ฅผ ์•ž์— ๋„ฃ์–ด ์ฃผ๋ฉด ๋œ๋‹ค.

์ƒ์„ธํŽ˜์ด์ง€ ๋งŒ๋“ค๊ธฐ

App.js์—์„œ ๋ผ์šฐํ„ฐ ์—ฐ๊ฒฐํ•ด์ค„ ๋•Œ movieId์™€ ๊ฐ™์€ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์“ธ ๋•Œ์—๋Š” :(์ฝœ๋ก )์„ ๋ถ™์ด๋Š” ๊ฒƒ์— ์ฃผ์˜ํ•œ๋‹ค.

moviesite_with_nodejs's People

Contributors

zoonun avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.