Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김건우
/
OSS
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Authored by
swjin
2019-11-08 10:42:19 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1045e502f1eae0b8684dc3fef4d07dda3a8061e6
1045e502
1 parent
c37d9d67
json example
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
Experiments/experiments09/assignments/assignment01/app.js
Experiments/experiments09/assignments/assignment01/app.js
View file @
1045e50
...
...
@@ -14,6 +14,14 @@ app.get('/book/:bookId', function (req, res) {
res
.
send
(
books
[
bookId
]);
});
/*
{
"id" : 2,
"name" : "book2",
"price" : 2000,
"author" : "jin"
}
*/
app
.
post
(
'/book'
,
function
(
req
,
res
)
{
// Create book information
books
[
req
.
body
.
id
]
=
[
req
.
body
.
id
,
req
.
body
.
name
,
req
.
body
.
price
,
req
.
body
.
author
];
...
...
@@ -28,7 +36,7 @@ app.put('/book/:bookId', function (req, res) {
app
.
delete
(
'/book/:bookId'
,
function
(
req
,
res
)
{
// Delete book information
})
var
server
=
app
.
listen
(
80
);
console
.
log
(
books
);
...
...
Please
register
or
login
to post a comment