Skip to content

Commit c0ecd44

Browse files
committed
Update Node.js example
1 parent e842175 commit c0ecd44

19 files changed

+6067
-212
lines changed

NodeRestAPI/.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
run.cmd
1+
.vscode
2+
dist
23
node_modules
3-
typings
4+
dist-test

NodeRestAPI/Gulpfile.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

NodeRestAPI/client/app.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

NodeRestAPI/client/default.html

Lines changed: 0 additions & 24 deletions
This file was deleted.

NodeRestAPI/demo.http

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
@host = http://localhost:8080/api
2+
3+
// Get a list of people
4+
GET {{host}}/people
5+
6+
###
7+
// Get a list of todo items
8+
GET {{host}}/todos
9+
10+
###
11+
// Add a todo item
12+
POST {{host}}/todos
13+
Content-Type: application/json
14+
15+
{
16+
"description": "Shopping",
17+
"assignedTo": "Eve"
18+
}
19+
20+
###
21+
// Add a todo item with unknown person
22+
POST {{host}}/todos
23+
Content-Type: application/json
24+
25+
{
26+
"description": "Shopping",
27+
"assignedTo": "Nobody"
28+
}
29+
30+
###
31+
// Get first todo item
32+
GET {{host}}/todos/0
33+
34+
###
35+
// Update todo item
36+
PATCH {{host}}/todos/0
37+
Content-Type: application/json
38+
39+
{
40+
"description": "Homework"
41+
}
42+
43+
###
44+
// Update todo item to unknown person
45+
PATCH {{host}}/todos/0
46+
Content-Type: application/json
47+
48+
{
49+
"assignedTo": "Nobody"
50+
}
51+
52+
###
53+
GET {{host}}/todos
54+
55+
###
56+
// Update todo item
57+
PATCH {{host}}/todos/0
58+
Content-Type: application/json
59+
60+
{
61+
"done": true
62+
}
63+
64+
###
65+
GET {{host}}/todos
66+
67+
###
68+
// Delete todo item
69+
DELETE {{host}}/todos/0
70+
71+
###
72+
GET {{host}}/todos

0 commit comments

Comments
 (0)