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
travel
Commits
d1179528
Commit
d1179528
authored
Jul 20, 2022
by
Yoon, Daeki
😅
Browse files
업로드 서버쪽 주소 변경
parent
fe5f5fe5
Changes
2
Show whitespace changes
Inline
Side-by-side
src/app.ts
View file @
d1179528
import
cookieParser
from
"
cookie-parser
"
;
import
cookieParser
from
"
cookie-parser
"
;
import
express
,
{
Request
,
Response
,
NextFunction
}
from
"
express
"
;
import
express
,
{
Request
,
Response
,
NextFunction
}
from
"
express
"
;
import
path
from
"
path
"
;
import
router
from
"
./routes
"
;
import
router
from
"
./routes
"
;
const
app
=
express
();
const
app
=
express
();
...
@@ -10,7 +11,7 @@ app.use(cookieParser());
...
@@ -10,7 +11,7 @@ app.use(cookieParser());
app
.
use
(
"
/api
"
,
router
);
app
.
use
(
"
/api
"
,
router
);
app
.
use
(
express
.
static
(
__dirname
+
"
/upload
"
));
app
.
use
(
"
/images
"
,
express
.
static
(
path
.
join
(
__dirname
,
"
..
"
,
"
/upload
s
"
)
));
app
.
use
((
err
:
any
,
req
:
Request
,
res
:
Response
,
next
:
NextFunction
)
=>
{
app
.
use
((
err
:
any
,
req
:
Request
,
res
:
Response
,
next
:
NextFunction
)
=>
{
console
.
log
(
"
익스프레스 에러:
"
,
err
);
console
.
log
(
"
익스프레스 에러:
"
,
err
);
...
...
src/routes/profile.route.ts
View file @
d1179528
...
@@ -3,8 +3,9 @@ import { userCtrl, authCtrl } from "../controllers";
...
@@ -3,8 +3,9 @@ import { userCtrl, authCtrl } from "../controllers";
const
router
=
express
.
Router
();
const
router
=
express
.
Router
();
router
.
route
(
"
/
"
).
get
(
authCtrl
.
requireLogin
,
userCtrl
.
getProfile
);
router
.
route
(
"
/
"
)
router
.
route
(
"
/
"
).
post
(
authCtrl
.
requireLogin
,
userCtrl
.
postPicture
);
//중간에 req쪽에 fields와 files 넣는 미들웨어 추가
.
get
(
authCtrl
.
requireLogin
,
userCtrl
.
getProfile
)
.
post
(
authCtrl
.
requireLogin
,
userCtrl
.
postPicture
);
//중간에 req쪽에 fields와 files 넣는 미들웨어 추가
export
default
router
;
export
default
router
;
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