Code Monkey home page Code Monkey logo

todo-api's Introduction

todo-api

Simple REST API for serving a ToDo application, by authenticating authors with JWT and providing the basic CRUD interface to manipulate ToDos.

Running the Application

Dependencies:

  • docker
  • docker-compose (only need to install separately on linux)
  • node (tests only)
  • npm (tests only)

To start up the application run docker-compose up in the project root. This will start two separate containers, a postgresql database instance, and the express web server, which will listening on localhost:3000.

For running tests:

  • execute npm install to install dependencies on the local environment.
  • execute npm run test:db this will start up a test database in a docker container.
  • in a new terminal run npm test.

API Interface

Method Path Request Body Response Body Protected
GET /api/authors { firstName: string, lastName: string, email: string }
POST /api/authors { firstName: string, lastName: string, email: string, password: string } { accessToken: string }
POST /api/authors/auth { email: string, password: string } { accessToken: string }
PUT /api/authors { firstName: string, lastName: string }
DELETE /api/authors
GET /api/todos { todos: [{ todoID: int, title: string, body: string }] }
POST /api/todos { title: string, body: string } { todoID: int, title: string, body: string }
PUT /api/todos/:todoID { title: string, body: string }
DELETE /api/todos/:todoID

todo-api's People

Contributors

davidkarolyi avatar

Stargazers

 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.