Giter Site home page Giter Site logo

todos2reactapp's Introduction

Todos app

How to install and run app

  1. npm install
  2. npm start
  3. open app on http://localhost:3000

Backend

Backend is a json-server on a static json file located in todomvc/data.json.

API

Just a short API documentation for our todo app.


GET /todos

Returns an array of all todo items.


POST /todos

Creates a todo item.

Example of an item payload:

{
  "title": "buy milk",
  "completed": false,
  "id": 1
}

PATCH /todos/{id}

Edits todo item, usually to change completed state. {id} stands for todo id.

Example payload:

{
  "completed": true
}

DELETE /todos/{id}

Deletes todo item with given id.


DELETE /todos

Deletes all todos.


POST /todos/seed

Seed an array of todos. Payload needs to be an array of objects, containing todos. This request rewrites all todos.


POST /signup

Creates a new account. Example payload:

{
  "email": "[email protected]",
  "password": "abc123"
}

Example error statuses:

409 (Conflict) - Account already exists

401 (Unauthorized) - Email or password was not provided

Request headers:

sendwelcomeemail: true - Sends welcome email to signed up user

Response headers:

Set-Cookie: "auth=true;"


POST /login

Logs into a new account.

Example payload:

{
  "email": "[email protected]",
  "password": "abc123"
}

Response headers:

Set-Cookie: "auth=true;"

Example error statuses:

401 (Unauthorized) - Wrong email or password


POST /reset

Deletes all todos and all accounts.


DELETE /accounts

Deletes all accounts.


POST /accounts/seed

Seed an array of accounts. Payload needs to be an array of objects, containing accounts. This request rewrites all accounts.

todos2reactapp's People

Contributors

arthyrych avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.