/reqres

A hosted REST-API ready to respond to your AJAX requests

Primary LanguageJavaScript

ReqRes

ReqRes is a bare-bones ExpressJS application.

Docs & Demos ⇒

Installation

  • Clone repo
  • Make sure Node.js is installed on your machine
  • npm install
  • node app.js or use Nodemon

Testing

npm test

This generates the final data set file and runs unit tests against the available routes.

Tour

  • app.js - this is where we create the Express app and define all of our routes
  • index.js - this is the main file for the callback routes
  • config.json - this houses the pagination details & fake session token
  • resources_config.json - this houses the configurations specific to a particular resource
  • resources/*.json - this houses the individual resource data JSON files. The name of the file should be the name of the resource and the file should contain an array of items of that resource. Example: resources/movies.json
  • compile_data.js - run this using node compile_data.js to generate the final data-set file data.json.
  • data.json - this is the final data-set file. It is generated by joining all the individual resource JSON files.