dblodorn / vue-mirage-boilerplate

Simple starter web app with mirage.js for a mock API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 πŸ‘¨πŸ½β€πŸ’»

About

Simple starter web app with mirage.js for a mock API


Languages

Language:JavaScript 58.9%Language:Vue 29.5%Language:HTML 10.9%Language:CSS 0.7%