Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2-capstone-design2
/
2015104216
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
장준영
2020-12-12 01:06:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
617b7a17aaa71c467eba4c005a5571d9c75ba100
617b7a17
1 parent
e5316afc
refactor : app.js 수정
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
19 deletions
server/app.js
server/app.js
View file @
617b7a1
le
t
createError
=
require
(
'http-errors'
);
le
t
express
=
require
(
'express'
);
le
t
path
=
require
(
'path'
);
le
t
cookieParser
=
require
(
'cookie-parser'
);
le
t
logger
=
require
(
'morgan'
);
cons
t
createError
=
require
(
'http-errors'
);
cons
t
express
=
require
(
'express'
);
cons
t
path
=
require
(
'path'
);
cons
t
cookieParser
=
require
(
'cookie-parser'
);
cons
t
logger
=
require
(
'morgan'
);
le
t
indexRouter
=
require
(
'./routes/index'
);
cons
t
indexRouter
=
require
(
'./routes/index'
);
le
t
app
=
express
();
cons
t
app
=
express
();
// view engine setup
app
.
set
(
'views'
,
path
.
join
(
__dirname
,
'views'
));
...
...
@@ -21,19 +21,8 @@ app.use(express.static(path.join(__dirname, 'public')));
app
.
use
(
'/'
,
indexRouter
);
// catch 404 and forward to error handler
app
.
use
(
function
(
req
,
res
,
next
)
{
app
.
use
(
function
(
req
,
res
,
next
)
{
next
(
createError
(
404
));
});
// error handler
app
.
use
(
function
(
err
,
req
,
res
,
next
)
{
// set locals, only providing error in development
res
.
locals
.
message
=
err
.
message
;
res
.
locals
.
error
=
req
.
app
.
get
(
'env'
)
===
'development'
?
err
:
{};
// render the error page
res
.
status
(
err
.
status
||
500
);
res
.
render
(
'error'
);
});
module
.
exports
=
app
;
...
...
Please
register
or
login
to post a comment