Express review with intro to axios
- npm install Express Docs Axios Docs
- Create a basic express server in server/index.js
- Assign a port and begin listening
- Add a start script to start your server with nodemon
- Use express.static to serve our index.html in client/dist/
- Create a basic .get to path '/name' that sends a response with your name
- Build a controller that handles GET POST and DELETE and export it
- Your controller should send back a message indicating that it received the request
- Build a router using express.Router to use our controller
- Have your express server use your router for routes to '/api'
- npm run build to start webpack
- Add our bundle to index.html
- Create an array in your controller to represent your database of todos and give it some default todos
- Refactor your GET request to send your array of todos
- Use axios to add functionality to getTodos
- Refactor your POST request to add to our array of todos
- Use axios to add functionality to postTodo
- Refactor your DELETE request to remove from our array given an index
- Use axios to add functionality to deleteTodo