Mock Endpoints with Webpack Dev Server
Marlena Baker
Full Stack Web Devloper
Galvanize Instructor
Front End @ HomeAdvisor
Founder / Full Stack @ Little Bird
Twitter: @marlena_baker2
marlenabaker.tech
Github: baker-marlena
LinkedIn: marlenabaker
Describe Webpack Dev Server
Identify it in our generated Vue app
Experiment with configuring it
Generate mock endpoints
marlenabaker.tech
Webpack Dev Server
- A package for serving your app locally
- Tight feedback loop
- Highly configurable

marlenabaker.tech
Where does it live?


Vue CLI 2 webpack template
Vue CLI 3 no plugins
marlenabaker.tech
How do we configure it?
https://webpack.js.org/configuration/dev-server/
https://cli.vuejs.org/config/#devserver

marlenabaker.tech
Mock Endpoints
`before`
execute middleware before running the internal middleware
pass it the app itself as the only argument
attach routes to the app
mock to your heart's content
marlenabaker.tech
Let's do it!
Describe Webpack Dev Server
Identify it in our generated Vue app
Experiment with configuring it
Generate mock endpoints
marlenabaker.tech
Marlena Baker
Twitter: @marlena_baker2
marlenabaker.tech
Github: baker-marlena
LinkedIn: marlenabaker
Questions?
Thank You!
deck
By Marlena Baker
deck
- 225