Commit 1cfd8a38 authored by Kim, Subin's avatar Kim, Subin
Browse files

baseUrl 적용

parent d699f7dd
import axios from "axios";
import baseUrl from "../utils/baseUrl.js";
const signup = async (user) => {
const url = `/api/auth/signup`;
const url = `${baseUrl}/api/auth/signup`;
const { data, status } = await axios.post(url, user);
return { data, status }
}
const login = async (user) => {
const url = `/api/auth/login`;
const url = `${baseUrl}/api/auth/login`;
const { data, status } = await axios.post(url, user);
return { data, status }
}
......
import axios from "axios";
import baseUrl from "../utils/baseUrl.js";
const addsubject = async (info) => {
console.log('info확인', info)
const url = `/api/subject/addsubject`;
const url = `${baseUrl}/api/subject/addsubject`;
const { data, status } = await axios.post(url, info);
console.log('data status', data, '|', status)
return { data, status }
}
const subjectApi = {
addsubject
};
......
import clientConfig from './clientConfig'
const baseUrl = process.env.NODE_ENV === 'production'
? `http://localhost:3001/${clientConfig.serverRoot}`
: ""
export default baseUrl
\ No newline at end of file
const config = {
env: process.env.NODE_ENV === 'production' ? 'production' : 'development',
serverRoot: '/',
loginUser: 'todayKU-user',
}
export default config
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment