Toggle navigation
Toggle navigation
This project
Loading...
Sign in
zuzitsu
/
UR_Village
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
Suyeon Jung
2020-11-29 15:15:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4cd93adb7cccf7b21a836ffa6deb41f1006f1df9
4cd93adb
1 parent
49d73fc9
Modify index and select view
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
101 additions
and
57 deletions
app.js
package.json
routes/index.js
routes/login.js → routes/select.js
imgs/logo.png → static/logo.png
views/base.pug
views/index.pug
views/category.pug → views/select.pug
app.js
View file @
4cd93ad
...
...
@@ -6,7 +6,7 @@ var logger = require('morgan');
var
indexRouter
=
require
(
'./routes/index'
);
var
usersRouter
=
require
(
'./routes/users'
);
var
loginRouter
=
require
(
'./routes/login
'
)
var
selectRouter
=
require
(
'./routes/select
'
)
var
app
=
express
();
var
bodyParser
=
require
(
'body-parser'
);
// view engine setup
...
...
@@ -17,27 +17,27 @@ app.use(logger('dev'));
app
.
use
(
express
.
json
());
app
.
use
(
express
.
urlencoded
({
extended
:
false
}));
app
.
use
(
cookieParser
());
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'/
imgs
'
)));
//정적파일 위치
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'/
static
'
)));
//정적파일 위치
app
.
use
(
'/'
,
indexRouter
);
app
.
use
(
'/users'
,
usersRouter
);
app
.
use
(
'/
login'
,
login
Router
)
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}));
app
.
use
(
'/
select'
,
select
Router
)
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}));
// catch 404 and forward to error handler
app
.
use
(
function
(
req
,
res
,
next
)
{
next
(
createError
(
404
));
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
:
{};
// 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'
);
// render the error page
res
.
status
(
err
.
status
||
500
);
res
.
render
(
'error'
);
});
module
.
exports
=
app
;
module
.
exports
=
app
;
\ No newline at end of file
...
...
package.json
View file @
4cd93ad
{
"name"
:
"ur-village"
,
"version"
:
"0.0.0"
,
"private"
:
true
,
"scripts"
:
{
"start"
:
"node ./bin/www"
},
"dependencies"
:
{
"cookie-parser"
:
"~1.4.4"
,
"debug"
:
"~2.6.9"
,
"express"
:
"~4.16.1"
,
"http-errors"
:
"~1.6.3"
,
"morgan"
:
"~1.9.1"
,
"pug"
:
"2.0.0-beta11"
}
"name"
:
"ur-village"
,
"version"
:
"0.0.0"
,
"private"
:
true
,
"scripts"
:
{
"start"
:
"nodemon ./bin/www"
},
"dependencies"
:
{
"cookie-parser"
:
"~1.4.4"
,
"debug"
:
"~2.6.9"
,
"express"
:
"~4.16.1"
,
"http-errors"
:
"~1.6.3"
,
"morgan"
:
"~1.9.1"
,
"nodemon"
:
"^2.0.6"
,
"pug"
:
"2.0.0-beta11"
}
}
...
...
routes/index.js
View file @
4cd93ad
...
...
@@ -3,10 +3,6 @@ var router = express.Router();
/* GET home page. */
router
.
get
(
'/'
,
function
(
req
,
res
,
next
)
{
res
.
render
(
'base'
,
{
title
:
'Express'
}
);
res
.
render
(
'index'
);
});
router
.
get
(
'/category'
,
function
(
req
,
res
){
var
location
=
req
.
query
.
location
;
res
.
render
(
'category'
);
});
module
.
exports
=
router
;
module
.
exports
=
router
;
\ No newline at end of file
...
...
routes/
login
.js
→
routes/
select
.js
View file @
4cd93ad
...
...
@@ -3,10 +3,8 @@ var router = express.Router();
/* GET home page. */
router
.
get
(
'/login'
,
function
(
req
,
res
){
var
location
=
req
.
query
.
location
;
res
.
render
(
'category'
);
res
.
send
(
location
);
});
router
.
post
(
'/'
,
function
(
req
,
res
)
{
res
.
render
(
'select'
,
{
'si'
:
req
.
body
.
si
,
'ku'
:
req
.
body
.
ku
});
});
module
.
exports
=
router
;
module
.
exports
=
router
;
\ No newline at end of file
...
...
imgs
/logo.png
→
static
/logo.png
View file @
4cd93ad
14.7 KB
views/base.pug
deleted
100644 → 0
View file @
49d73fc
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content
<img src="./logo.png" alt ="error">
form(action ='/category' method = 'get')
p
input(type='text' name = 'location')
input(type ='submit')
\ No newline at end of file
views/index.pug
View file @
4cd93ad
extends layout
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content
img.image(src='/logo.png')
form(action='/select' method='post' id='location')
select(name="si")
option(value="select") 시
option(value="수원시") 수원시
option(value="성남시") 성남시
option(value="의정부시") 의정부시
option(value="안양시") 안양시
option(value="부천시") 부천시
option(value="광명시") 광명시
option(value="평택시") 평택시
option(value="동두천시") 동두천시
option(value="안산시") 안산시
option(value="고양시") 고양시
option(value="과천시") 과천시
option(value="구리시") 구리시
option(value="남양주시") 남양주시
option(value="오산시") 오산시
option(value="시흥시") 시흥시
option(value="군포시") 군포시
option(value="의왕시") 의왕시
option(value="하남시") 하남시
option(value="용인시") 용인시
option(value="파주시") 파주시
option(value="이천시") 이천시
option(value="안성시") 안성시
option(value="김포시") 김포시
option(value="화성시") 화성시
option(value="광주시") 광주시
option(value="양주시") 양주시
option(value="포천시") 포천시
option(value="여주시") 여주시
block content
h1= title
p Welcome to #{title}
select(name="ku")
option(value="select") 구
option(value="장안구") 장안구
option(value="권선구") 권선구
option(value="팔달구") 팔달구
option(value="영통구") 영통구
option(value="수정구") 수정구
option(value="중원구") 중원구
option(value="분당구") 분당구
option(value="만안구") 만안구
option(value="동안구") 동안구
option(value="원미구") 원미구
option(value="소사구") 소사구
option(value="오정구") 오정구
option(value="상록구") 상록구
option(value="단원구") 단원구
option(value="덕양구") 덕양구
option(value="일산동구") 일산동구
option(value="일산서구") 일산서구
option(value="처인구") 처인구
option(value="기흥구") 기흥구
option(value="수지구") 수지구
input(type ='submit')
\ No newline at end of file
...
...
views/
category
.pug
→
views/
select
.pug
View file @
4cd93ad
doctype html
//-
doctype html
html
head
if location =="n"
button k
body
block content
h1 #{si}
h1 #{ku}
...
...
Please
register
or
login
to post a comment