url http:localhost:3000 생략하기

이태규·2021년 12월 30일
0

vue

목록 보기
5/21

파일에 vue.config.js 파일을 만든다.

module.exports = {
    devServer:{
        proxy : {
            // 벡엔드의 http://localhost:3000이 
            // vue에서 url 주소를 생략하여 사용가능 하도록 설정
            '/board' : {
                target:'http://localhost:3000',
                changeOrigin :true,
                logLevel : 'debug'
            },
            '/item' : {
                target:'http://localhost:3000',
                changeOrigin :true,
                logLevel : 'debug'
            }
        }
    }
}

주의 ! CMD를 다시 실행시켜줄 것

profile
한 걸음씩 나아가자

0개의 댓글