todo-mvc-service
v0.0.11
Published
mock API for TodoMVC apps
Downloads
6
Readme
Todo MVC Service
A mock API for TodoMVC apps
Quick Start
import Todo from 'todo-mvc-service'
Todo.fetch('todos', {
method: 'POST',
body: {
title: 'Buy milk',
completed: false,
}
})
Todo
.fetch('/todos')
.then(res => res.json())
.then(todos => console.log('todos', todos))
Routes
console.log(Todo.routes)
└── /
└── todos (GET|POST)
└── /
└── :id (GET)
:id (PUT)
:id (DELETE)
Known Issues
- Does not work with UglifyJS, so create-react-app's prod mode does not work. I'm looking into changing the webpack config to transpile the dependencies (PR welcome... for the webpack experts in the audience 😃).
- Needs tests