todo-mvc-service

0.0.11 • Public • Published

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

Demo

Readme

Keywords

Package Sidebar

Install

npm i todo-mvc-service

Weekly Downloads

1

Version

0.0.11

License

MIT

Last publish

Collaborators

  • alexkrolick