Skip to content

alexkrolick/todo-mvc-service

Repository files navigation

Todo MVC Service

A mock API for TodoMVC apps. Provides a fetch method with a similar API to window.fetch. Persists data to localStorage, with a random delay to simulate a network connection.

Demo

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

  • Needs tests

About

mock API for TodoMVC apps

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published