mock.js 801 Bytes
var express = require('express');

exports = module.exports = function (IoC, policies, settings) {
	var app = this;
	var router = express.Router();
	var controller = IoC.create('controllers/mock');

	router.get(
		'/*',
		policies.ensureLoggedOut(),
		controller.get
	);

	router.post(
		'/*',
		policies.ensureLoggedOut(),
		controller.post
	);

	router.put(
		'/*',
		policies.ensureLoggedOut(),
		controller.put
	);

	router.patch(
		'/*',
		policies.ensureLoggedOut(),
		controller.patch
	);

	router.head(
		'/*',
		policies.ensureLoggedOut(),
		controller.head
	);

	router.delete(
		'/*',
		policies.ensureLoggedOut(),
		controller.delete
	);

	app.use(settings.prefix + 'mock/api', router);
};

exports['@require'] = ['$container', 'policies', 'igloo/settings'];
exports['@singleton'] = true;