node-fake-api-server

0.1.5 • Public • Published

Fake API Server

Build Status Sonarcloud Status Coverage Status Codacy Badge DeepScan grade

This tool allows you to register collections of arbitrary endpoints to mock responses for, allowing you to easily test your code end-to-end.

Pair with the Fake API Client for easy collection registration.

View the API Documentation to get a better idea of how to use the Fake API.

A server instance has been set up at https://node-fake-api-server.herokuapp.com/.

Schema

We have defined an Open API Specification as well as a detailed JSON Schema of the request payloads.

Usage

Run Locally (Private)

npm install -g node-fake-api-server
fake-api-server

Run Locally (Public)

npm install -g node-fake-api-server
fake-api-server --public

Run In Code

const http = require('http');
const app = require('node-fake-api-server');
 
const port = Math.floor(Math.random() * 2000) + 3000;
 
app.set('port', port);
 
const server = http.createServer(app);
server.listen(port);
 
server.on('listening', () => {
    // do stuff...
});

Readme

Keywords

none

Package Sidebar

Install

npm i node-fake-api-server

Weekly Downloads

1

Version

0.1.5

License

Apache-2.0

Unpacked Size

89.5 kB

Total Files

39

Last publish

Collaborators

  • thejmather