Toggle navigation
Toggle navigation
This project
Loading...
Sign in
신정아
/
weather_chatbot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
1
Network
Create a new issue
Commits
Issue Boards
Authored by
진성욱
2020-05-01 11:15:00 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e719738488a5c0b1b5cafe277ae89a72a48ca07e
e7197384
1 parent
16174c1c
Updated
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
Experiments/express/assignments/assignment02/app.js
Experiments/express/assignments/assignment02/app.js
View file @
e719738
...
...
@@ -9,8 +9,14 @@ app.use(bodyParser.json());
var
users
=
new
Array
();
app
.
get
(
'/login'
,
function
(
req
,
res
)
{
users
[
0
]
=
{
"userId"
:
0
,
"name"
:
"jin"
,
"password"
:
"abc"
,
"isAdmin"
:
true
}
app
.
put
(
'/login'
,
function
(
req
,
res
)
{
// users 배열에서 찾도록 처리 해야 함
// admin 여부를 확인하여 체크
// req.body.id : ID
...
...
@@ -19,7 +25,7 @@ app.get('/login', function (req, res) {
res
.
send
(
"Login"
);
});
app
.
ge
t
(
'/logout'
,
function
(
req
,
res
)
{
app
.
pu
t
(
'/logout'
,
function
(
req
,
res
)
{
// Logout
// 세션 유효 여부를 체크하고 세션 Delete
req
.
session
.
userId
=
null
;
...
...
Please
register
or
login
to post a comment