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
survey
Commits
7b582987
Commit
7b582987
authored
Jul 16, 2022
by
Yoon, Daeki
😅
Browse files
front에서 이미지 요청 방법
parent
4949c01d
Changes
4
Show whitespace changes
Inline
Side-by-side
frontend/src/apis/baseUrl.ts
View file @
7b582987
export
default
"
/api
"
;
export
const
baseImageUrl
=
"
http://localhost:3000/images
"
;
frontend/src/apis/index.ts
View file @
7b582987
export
*
as
authApi
from
"
./auth.api
"
;
export
*
as
questionApi
from
"
./question.api
"
export
*
as
surveyApi
from
"
./survey.api
"
export
*
as
questionApi
from
"
./question.api
"
;
export
*
as
surveyApi
from
"
./survey.api
"
;
export
{
baseImageUrl
}
from
"
./baseUrl
"
;
frontend/src/profile/Profile.tsx
View file @
7b582987
import
React
,
{
useState
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
surveyApi
}
from
"
../apis
"
;
import
{
baseImageUrl
,
surveyApi
}
from
"
../apis
"
;
import
{
SurveyType
}
from
"
../types
"
;
export
const
Profile
=
()
=>
{
...
...
@@ -21,6 +21,7 @@ export const Profile = () => {
return
(
<
div
className
=
"flex flex-col items-center"
>
<
div
className
=
"m-5"
>
나의 설문조사
</
div
>
<
img
src
=
{
`
${
baseImageUrl
}
/9e24ad36a2947b08c89913b01`
}
/>
<
div
className
=
"flex space-x-4 mt-5"
>
<
button
onClick
=
{
createSurvey
}
...
...
src/app.ts
View file @
7b582987
import
cookieParser
from
"
cookie-parser
"
;
import
express
,
{
Request
,
Response
,
NextFunction
}
from
"
express
"
;
import
path
from
"
path
"
;
import
router
from
"
./routes
"
;
const
app
=
express
();
...
...
@@ -8,6 +9,8 @@ app.use(express.json());
app
.
use
(
express
.
urlencoded
({
extended
:
true
}));
app
.
use
(
cookieParser
());
app
.
use
(
"
/images
"
,
express
.
static
(
path
.
join
(
__dirname
,
"
..
"
,
"
/uploads
"
)));
app
.
use
(
"
/api
"
,
router
);
app
.
use
((
err
:
any
,
req
:
Request
,
res
:
Response
,
next
:
NextFunction
)
=>
{
...
...
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