inblog logo
|
Coding's note
    React

    라우터

    이소연's avatar
    이소연
    Aug 05, 2024
    라우터
    Contents
    axios
    notion image
     
    app.js
    import { Route, Routes } from "react-router-dom"; import Header from "./components/Header"; function App() { return ( <div> <Header /> <Routes> <Route path="/" element={<Home />} /> <Route path="/saveForm" element={<SaveForm />} /> <Route path="/post/:id" element={<Detail />} /> <Route path="/loginForm" element={<LoginForm />} /> <Route path="/joinForm" element={<JoinForm />} /> <Route path="/updateForm/:id" element={<UpdateForm />} /> </Routes> </div> ); } export default App;
    notion image
    notion image
    was가 필요햄. js를 jsp로 읽기 위해?
     
    client는 3가지만 다운받으면 됨.
    그럼 다운 받을 수 있는 서버가 필요.
    그걸 frontserver라고 함. 아파치만 설치되면 됨.
    브라우저만 가능함.
     
    파일요청하면 파일 그냥 주는 것. -아파치,nginx
    was는 자바코드를 해석해서 주는 것.
    notion image
    notion image
    최초에는 /post는 요청 x
    최초에는 /만 됨.
    single page~~라서?
    관련 파일은 bundle안에 다 다운 받아야 한다고?
    최초의 /요청이 안됨. / 요청하면 fs의 모든 js파일을 다 준다고?
     
     
    client가 요청하는 것
    notion image
    cors
    notion image
    최초 요청한 도메인 주소가 브라우저 주소가 된다.
    bs는 3000만 열어주면 된다고?
    notion image
    pri polite 요청-v
    notion image
    package com.cos.jwt.config.filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletResponse; public class CorsFilter implements Filter{ public static final String TAG = "MyFilter1 : "; @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { System.out.println("CORS 필터 작동"); HttpServletResponse resp = (HttpServletResponse) response; resp.setHeader("Access-Control-Allow-Origin", "*"); resp.setHeader("Access-Control-Allow-Methods", "*"); resp.setHeader("Access-Control-Allow-Headers", "*"); // 해당 헤더가 없으면 아래 7가지의 header값만 응답할 수 있다. // Cache-Control //Content-Language //Content-Length //Content-Type //Expires //Last-Modified //Pragma resp.setHeader("Access-Control-Expose-Headers", "*"); chain.doFilter(request, response); } }
    @RequiredArgsConstructor @Configuration public class FilterConfig { @Bean public FilterRegistrationBean<CorsFilter> corsFilter(){ System.out.println("CORS 필터 등록"); FilterRegistrationBean<CorsFilter> bean = new FilterRegistrationBean<>(new CorsFilter()); bean.addUrlPatterns("/*"); bean.setOrder(0); // 낮은 번호부터 실행됨. return bean; } }
    .env 파일 만들어서 환경변수 만드는 것.?
     
    notion image
    notion image
     
    notion image
    notion image
    notion image
    notion image
    notion image
     
    use selector
    use dispatch
    notion image
    notion image
    129.??99???_쌤거?
    notion image
     

    axios

    notion image
    notion image
    notion image
    notion image
    notion image
    notion image
     
    key
    youtube.
    When to Use Keys - Flutter Widgets 101 Ep. 4
    In this episode, you will learn about key parameters on widgets: when you need keys, where to put keys in your widget tree, and which key is right for you. More specifically, you'll learn about he nuances of how keys work, discern when to use keys in your widget hierarchy, and identify the appropriate types of keys to optimize your widget-based structures. Chapters: 0:00 - Intro 0:39 - When to use keys 2:20 - How keys work 5:13 - Where to put keys 6:53 - Types of Keys Watch other episodes in the series → http://bit.ly/FlutterWidgets101 Subscribe to Google for Developers → https://goo.gle/developers
    When to Use Keys - Flutter Widgets 101 Ep. 4
    https://www.youtube.com/watch?v=kn0EOS-ZiIc
    When to Use Keys - Flutter Widgets 101 Ep. 4
    notion image
    쌤 코드 참조
     
    Share article
    Contents
    axios

    Coding's note

    RSS·Powered by Inblog