Skip to content

dblodorn/vue-mirage-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VUE MIRAGE BOILERPLATE

Simple starter web app: Vue.js frontend, webpack 4 config, vue-styled- components with mirage.js for a mock API to develop against.

What is Mirage

"Mirage JS is an API mocking library that lets you build, test and share a complete working JavaScript application without having to rely on any backend services."

Why

Like Vue? Wanna prototype some kinda web app thingy? This is a good starting place. I've also included my preferred webpack config as opposed to VUE-CLI, cause chances are you may want to add or modify your build steps. And threw in the vue port of Styled Components - CAUSE STYLED COMPONENTS IS THA BEST - for styling!

TO RUN

- Install Depenedencies
yarn

- Develop
yarn dev

THE API JAZZ:

You Can define your endpoints, schemas etc in: src/server.js

// GET Request
this.get('/todos', schema => {
  return schema.todos.all()
})

// POST Request
this.post('/todos', (schema, request) => {
  let todo_item = JSON.parse(request.requestBody).todo_item
  return schema.todos.create({ todo_item })
})

CHECK IT OUT 🤙🏻

Image of Boilerplate in Action

👩‍💻 HAVE FUN 👨🏽‍💻