Git Product home page Git Product logo

box-todo's Introduction

Todo List Server

The todo list server is a simple HTTP server than allows you to implement todo list tasks and save them for the session.

The tasks are stored in memory for as long as the server runs. When the server stops, all information is lost.

Prerequisites

You must have Node.js in order to use the server. If you don't have it installed already, please visit the Node.js site for installation instructions.

Starting the Server

node index.js

Stopping the Server

Hit Ctrl+C (Cmd+C on Macs).

Supported Requests

There are several endpoints for you to hit in order to interact with tasks. All endpoints work using JSON exclusively, so both request bodies (when used) and response bodies must be in JSON format.

Warning: To simulate real-life server interaction, there is a 10% chance that any given request will fail. Be sure you take this into account.

GET /todo/tasks

Retrieves a JSON array of the saved tasks.

POST /todo/tasks/create

When you post a JSON object to this URL, it creates a task object in memory. It is up to you to decide what data to store on this object. This server just stores and sends back whatever data you add. A new ID is created and assigned to the id property of the object, then the object is returned as the response body (with the id property added).

POST /todo/tasks/:id/edit

The :id is a placeholder for a task ID, so you would need to fill it in such as /todo/tasks/12/edit.

When you post a JSON object to this URL, the data in that object is merged into the task with the given task ID. In this way, you can modify existing properties or add new properties to existing tasks. The only property that cannot be edited is the id property.

box-todo's People

Watchers

 avatar  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.