mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-04 07:46:21 +02:00
34 lines
1020 B
JavaScript
34 lines
1020 B
JavaScript
"use strict";
|
|
/*
|
|
* @adonisjs/bodyparser
|
|
*
|
|
* (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 });
|
|
class BodyParserProvider {
|
|
constructor(app) {
|
|
this.app = app;
|
|
}
|
|
/**
|
|
* Registers the bodyparser middleware namespace to the container.
|
|
*/
|
|
register() {
|
|
this.app.container.bind('Adonis/Core/BodyParser', () => {
|
|
const { BodyParserMiddleware } = require('../src/BodyParser/index');
|
|
return BodyParserMiddleware;
|
|
});
|
|
}
|
|
/**
|
|
* Adding the `file` macro to add support for reading request files.
|
|
*/
|
|
boot() {
|
|
const extendRequest = require('../src/Bindings/Request').default;
|
|
extendRequest(this.app.container.resolveBinding('Adonis/Core/Request'));
|
|
}
|
|
}
|
|
exports.default = BodyParserProvider;
|
|
BodyParserProvider.needsApplication = true;
|