mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-04 07:46:21 +02:00
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
"use strict";
|
|
/*
|
|
* @adonisjs/shield
|
|
*
|
|
* (c) Harminder Virk <virk@adonisjs.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
/**
|
|
* Provider to register shield middleware
|
|
*/
|
|
class ShieldProvider {
|
|
constructor(app) {
|
|
this.app = app;
|
|
}
|
|
register() {
|
|
this.app.container.singleton('Adonis/Addons/Shield', () => {
|
|
const { ShieldMiddleware } = require('../src/ShieldMiddleware');
|
|
return ShieldMiddleware;
|
|
});
|
|
}
|
|
boot() {
|
|
this.app.container.withBindings(['Adonis/Core/Response'], (Response) => {
|
|
require('../src/Bindings/Response').default(Response);
|
|
});
|
|
this.app.container.withBindings(['Japa/Preset/ApiRequest', 'Japa/Preset/ApiClient'], (ApiRequest, ApiClient) => {
|
|
const { defineTestsBindings } = require('../src/Bindings/Tests');
|
|
defineTestsBindings(ApiRequest, ApiClient);
|
|
});
|
|
}
|
|
}
|
|
ShieldProvider.needsApplication = true;
|
|
exports.default = ShieldProvider;
|