Explaining how to use Axios library
Using the JSON data from JSONPlaceholder and Ironhack Movie Characters
- start mongo server
- Import the whole country list by running:
node ./bin/seed.js
in terminal.
// makes api GET calls to a remote server with help of Axios: http://localhost:3000/posts/ // list all posts from the source (jsonplaceholder.typicode.com/posts) http://localhost:3000/posts/1 // list one unique post by id from the source (jsonplaceholder.typicode.com/posts/1)
// makes api GET calls to a remote server with help of Axios: http://localhost:3000/characters/ // list all characters from the source http://localhost:3000/characters/1 // list one unique character by id from the source
// Serve json data with help of express local http://localhost:3000/api/countries // list all countries in the database you have on your machine. http://localhost:3000/api/countries/SE // show one unique country by country code.