How to use the @ng-apimock/core.processor function in @ng-apimock/core

To help you get started, we’ve selected a few @ng-apimock/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rickvandermey / angular-starterkit / mockserver / mockserver.js View on Github external
const ioc_container = require('@ng-apimock/core/dist/ioc-container');

const helper = require('./helper');

const apimock = require('@ng-apimock/core');
const devInterface = require('@ng-apimock/dev-interface');

const app = express();

// Check parameter otherwise fall back to port 4000
app.set('port', process.env.PORT || 4000);

// Specify which mocks and presets to load
// - mocks should end with .mock.json
// - presets should end with .preset.json
apimock.processor.process({
	src: './mockserver',
});

// Add additional logging to the mockServer so we can debug if certain calls ever happened
// NOTE: Enable to allow additional logging
app.use(morgan('dev'));

// Add form data parser so we can check deprecated request bodies
app.use(bodyParser.urlencoded({ extended: true }));

// Add API wide headers which are dictated by nginx
app.use(function(req, res, next) {
	res.header('Access-Control-Allow-Origin', 'https://localhost:4202');

	res.header(
		'Access-Control-Allow-Methods',

@ng-apimock/core

ng-apimock core module

MIT
Latest version published 3 months ago

Package Health Score

79 / 100
Full package analysis