Giter Club home page Giter Club logo

node-api's Introduction

Mock JSON API

This is an Mock API which is used for development of "Interviews Reports" app. It supports GET, PUT, POST, and DELETE requests against the mock API and note that changes are saved to db/db.json.

Getting Started

If you are not using yarn you can use npm instead.

> npm install
> npm start   

Load http://localhost:3333/api/companies using browser or some rest client

Endpoints

Application endpoints based on db/db.js objects and support REST standards. Meaning you can use GET, PUT, POST, PATCH and DELETE requests against provided endpoints.
Provided endpoints are:

  • http://localhost:3333/api/companies
  • http://localhost:3333/api/candidates
  • http://localhost:3333/api/reports
  • http://localhost:3333/api/users
// Post request payload example for "reports" endpoint
{
    "candidateId": 9451057,
    "candidateName": "Zula Feeney",
    "companyId": 92859858,
    "companyName": "Volkman - Schimmel",
    "interviewDate": "Fri Jan 11 2018 15:23:09 GMT+0100 (CET)",
    "phase": "cv",
    "status": "passed",
    "note": "Suscipit dolores sed ..."
}

Login

In order to access protected endpoints, user need to be authorized.
There is already created user in DB which credentials can be used in order to login.
Auth endpoint

POST http://localhost:3333/login

Request Payload

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

Successful login response

{
  "accessToken": "ey...Yc"
}

Token needs to be sent as header for each http request sent to API.

  { Authorization: 'Bearer <USER ACCESS TOKEN>' }

Additional info

Application data is in db/db.json file.

node-api's People

Contributors

vlastimir-bulatovic 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.