0.6.12 • Published 3 years ago

stub-api-server v0.6.12

Weekly downloads
127
License
MIT
Repository
github
Last release
3 years ago

ci codecov release

stub-api-server

This lib allows you to configure an HTTP server responding dynamic fake JSON.

The common usecase is stubbing a REST API for Integration Tests.

Introduction

stub-api-server allow you to define an endpoint based on a simple object

// routes/route.ts
import { RouteConfig } from 'stub-api-server';

const route: RouteConfig = {
  method: 'GET',
  path: '/hello',
  template: { message: 'Hello World' },
};

export default route;
// index.ts
import path from 'path';
import { StubApiServer } from 'stub-api-server';

const server = new StubApiServer();
server.useRoutesFromDir(path.resolve('./routes'));
server.start();
➜ ts-node index.ts
Starting server on http://localhost:8000
0.6.12

3 years ago

0.6.11

3 years ago

0.6.10

3 years ago

0.6.9

3 years ago

0.6.8

4 years ago

0.6.7

4 years ago

0.6.6

4 years ago

0.6.5

4 years ago

0.6.4

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.4.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

1.0.0

4 years ago