ng-apimock is a modular Node.js framework that provides the ability to use scenario based api mocking.
You can use it for:
yarn add @ng-apimock/core --dev
This is a minimal setup example of how you can manually use @ng-apimock/core
const apimock = require('@ng-apimock/core');
const express = require('express');
const app = express();
app.set('port', 9999);
apimock.processor.process({
src: 'mocks'
});
app.use(apimock.middleware);
app.listen(app.get('port'), () => {
console.log('@ng-apimock/core running on port', app.get('port'));
});
To start up the script just type:
node serve.js
This is a minimal setup example in TypeScript of how you can manually use @ng-apimock/core
import * as apimock from '@ng-apimock/core';
import express, { Application } from 'express';
const app: Application = express();
app.set('port', 9999);
apimock.processor.process({
src: 'mocks'
});
app.use(apimock.middleware);
app.listen(app.get('port'), () => {
console.log('@ng-apimock/core running on port', app.get('port'));
});
There are a few endpoints available when you startup @ng-apimock/core
:
/ngapimock/info
- responsible for providing information of the running instance/ngapimock/health
- responsible for providing status information/ngapimock/health/readiness
- readiness probe/ngapimock/health/liveness
- liveness probe
We have a few channels for contact:
@ng-apimock is MIT licensed.