Skip to content

Commit d4559b1

Browse files
authored
Merge pull request learncodeacademy#1 from VadimCpp/master
Added readme to vue 5 proj
2 parents f364501 + 7692d98 commit d4559b1

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

vue-5-dynamic-data/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
## Intro
3+
4+
From the video [Vue Tutorial #5 - AJAX data and Lifecycle Methods](https://youtu.be/inJDWcHmsss) you could notice there is REST service:
5+
6+
`http://rest.learncode.academy/api/vue-5/friends`
7+
8+
Infact "vue-5" is only user name. The common link is:
9+
10+
`http://rest.learncode.academy/api/{username}/friends`
11+
12+
## Check if data exists
13+
14+
It's possible that data has been deleted before you run an example and see this tutorial.
15+
Visit link below to see the data:
16+
17+
[http://rest.learncode.academy/api/someuser/friends](http://rest.learncode.academy/api/someuser/friends);
18+
19+
If data isn't there, move to the next chapter and create it!
20+
21+
## Add data via curl
22+
23+
Open console and run commands:
24+
25+
`curl -H "Content-Type:application/json" -X POST -d '{"name":"Will"}' http://rest.learncode.academy/api/someuser/friends`
26+
27+
`curl -H "Content-Type:application/json" -X POST -d '{"name":"John"}' http://rest.learncode.academy/api/someuser/friends`
28+
29+
`curl -H "Content-Type:application/json" -X POST -d '{"name":"Bill"}' http://rest.learncode.academy/api/someuser/friends`
30+
31+
32+
Then visit [http://rest.learncode.academy/api/someuser/friends](http://rest.learncode.academy/api/someuser/friends) and ensure the data has been added.
33+
34+
NOTE! Use `http://rest.learncode.academy/api/someuser/friends` in you main.js

0 commit comments

Comments
 (0)