Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
Today KU
Commits
1cfd8a38
Commit
1cfd8a38
authored
Nov 02, 2021
by
Kim, Subin
Browse files
baseUrl 적용
parent
d699f7dd
Changes
4
Hide whitespace changes
Inline
Side-by-side
client/src/apis/auth.api.js
View file @
1cfd8a38
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
baseUrl
from
"
../utils/baseUrl.js
"
;
const
signup
=
async
(
user
)
=>
{
const
signup
=
async
(
user
)
=>
{
const
url
=
`/api/auth/signup`
;
const
url
=
`
${
baseUrl
}
/api/auth/signup`
;
const
{
data
,
status
}
=
await
axios
.
post
(
url
,
user
);
const
{
data
,
status
}
=
await
axios
.
post
(
url
,
user
);
return
{
data
,
status
}
return
{
data
,
status
}
}
}
const
login
=
async
(
user
)
=>
{
const
login
=
async
(
user
)
=>
{
const
url
=
`/api/auth/login`
;
const
url
=
`
${
baseUrl
}
/api/auth/login`
;
const
{
data
,
status
}
=
await
axios
.
post
(
url
,
user
);
const
{
data
,
status
}
=
await
axios
.
post
(
url
,
user
);
return
{
data
,
status
}
return
{
data
,
status
}
}
}
const
authApi
=
{
const
authApi
=
{
signup
,
signup
,
login
login
};
};
...
...
client/src/apis/subject.api.js
View file @
1cfd8a38
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
baseUrl
from
"
../utils/baseUrl.js
"
;
const
addsubject
=
async
(
info
)
=>
{
const
addsubject
=
async
(
info
)
=>
{
console
.
log
(
'
info확인
'
,
info
)
console
.
log
(
'
info확인
'
,
info
)
const
url
=
`/api/subject/addsubject`
;
const
url
=
`
${
baseUrl
}
/api/subject/addsubject`
;
const
{
data
,
status
}
=
await
axios
.
post
(
url
,
info
);
const
{
data
,
status
}
=
await
axios
.
post
(
url
,
info
);
console
.
log
(
'
data status
'
,
data
,
'
|
'
,
status
)
console
.
log
(
'
data status
'
,
data
,
'
|
'
,
status
)
return
{
data
,
status
}
return
{
data
,
status
}
}
}
const
subjectApi
=
{
const
subjectApi
=
{
addsubject
addsubject
};
};
...
...
client/src/utils/baseUrl.js
0 → 100644
View file @
1cfd8a38
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
client/src/utils/clientConfig.js
0 → 100644
View file @
1cfd8a38
const
config
=
{
env
:
process
.
env
.
NODE_ENV
===
'
production
'
?
'
production
'
:
'
development
'
,
serverRoot
:
'
/
'
,
loginUser
:
'
todayKU-user
'
,
}
export
default
config
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment