Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이유제
/
CultureGallery
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-05 06:08:12 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cc331c3c966110ea66954e40c3ce09617f913f3c
cc331c3c
1 parent
071a71b7
Backend : 라우터 최소화(index.js 통합)
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
app.js
app.js
View file @
cc331c3
...
...
@@ -3,8 +3,8 @@ const path = require('path');
const
app
=
express
();
//화면 별 router 연결, 라우터 호출해서 페이지를 불러오는데 사용함.
var
mainRouter
=
require
(
'./routes'
)
//호출시
main
.js 실행 (main.js : title 할당하고 main.html 열어줌)
var
loginRouter
=
require
(
'./routes/login'
)
var
mainRouter
=
require
(
'./routes'
)
//호출시
index
.js 실행 (main.js : title 할당하고 main.html 열어줌)
//디폴트 포트 값 : 8000
app
.
set
(
'port'
,
process
.
env
.
PORT
||
8000
);
...
...
@@ -15,7 +15,7 @@ app.engine('html', require('ejs').renderFile);
//각각의 요청에서 router 호출해서 page를 전환함.
app
.
use
(
'/'
,
mainRouter
);
app
.
use
(
'/login'
,
log
inRouter
);
app
.
use
(
'/login'
,
ma
inRouter
);
//css, image 등 정적 파일을 public에서 불러옴 -> html과 연결함
...
...
Please
register
or
login
to post a comment