μ μ κ° μν μ 보λ₯Ό κ²μνκ³ , μ’μνλ μνλ μμ²ν μνμ λν 리뷰λ₯Ό λ¨κΈΈ μ μλ μλΉμ€
π λ°°ν¬ λ§ν¬ : https://film-archive.herokuapp.com/
(1) μ½λ 볡μ¬
λ³Έ λ νμ§ν 리λ₯Ό https://github.com/YounglanHong/Film_Archive.git μ£Όμλ₯Ό νμ©νμ¬ λ‘컬 νκ²½μ clone ν©λλ€.
git clone https://github.com/YounglanHong/Film_Archive.git
(2) ν¨ν€μ§ μ€μΉ
// ν΄λΌμ΄μΈνΈμ μλ² ν΄λμμ κ°κ° ν¨ν€μ§ μ€μΉλ₯Ό μ§νν©λλ€.
// cd Client & cd Server
npm install
(3) μ€ν
// film-archive client
cd Client
npm start
// film-archive server
cd Server
npm start
- API μ€μ
- π TMDB κ³μ μ€μ νμ΄μ§μμ
API key
λ₯Ό μ μ²ν©λλ€.
// src/config.js
// movie api
export const API_KEY = "YOUR_API_KEY";
export const API_URL = "https://api.themoviedb.org/3/";
export const IMAGE_URL = "https://image.tmdb.org/t/p/";
- Proxy μ€μ
CORS
μλ¬λ₯Ό λ°©μ§νκΈ° μν΄Proxy
λ₯Ό λ―Έλ€μ¨μ΄λ‘ μ€μ ν©λλ€.- μ°Έκ³ : π CRA config proxy manually
npm install http-proxy-middleware --save
// src/setupProxy.js
const { createProxyMiddleware } = require("http-proxy-middleware");
module.exports = function (app) {
app.use(
"/api",
createProxyMiddleware({
target: "http://localhost:5000",
changeOrigin: true,
})
);
};
- μΈμ¦ secretKey μ€μ
userId +
secretKey
= token
// config/secretKey.js
export const secretKey = "YOUR_SECRET_KEY";
-
mongoBDμ μ°κ²°
- μ°Έκ³ : π Connection String URI Format
// config/dev.js
module.exports = {
mongoURI:
"mongodb+srv:YOUR_CONNECTION_STRING",
};