ng-apimock core module
npm install @ng-apimock/core> ng-apimock is a modular Node.js framework that provides the ability to use scenario based api mocking.
You can use it for:
- local development
- dev-interface
- automated testing
- WebdriverIO
- Protractor
- Cypress
bash
yarn add @ng-apimock/core --dev
`$3
This is a minimal setup example of how you can manually use @ng-apimock/core
`js
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:
`bash
node serve.js
`$3
This is a minimal setup example in TypeScript of how you can manually use @ng-apimock/core
`ts
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'));
});
`
$3
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 probeWe have a few channels for contact:
@ng-apimock is MIT licensed.