Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
fix(bodyparser): inject config to the bodyparser instance
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Mar 24, 2016
1 parent f13d2d6 commit 92cf2f8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions providers/AppMiddlewareProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ const ServiceProvider = require('adonis-fold').ServiceProvider
class AppMiddlewareProvider extends ServiceProvider {

* register () {
this.app.bind('Adonis/Middleware/BodyParser', function () {
this.app.bind('Adonis/Middleware/BodyParser', function (app) {
const Config = app.use('Adonis/Src/Config')
const BodyParser = require('../src/BodyParser')
return new BodyParser()
return new BodyParser(Config)
})

this.app.bind('Adonis/Middleware/Cors', function (app) {
Expand All @@ -32,4 +33,4 @@ class AppMiddlewareProvider extends ServiceProvider {

}

module.exports = AppMiddlewareProvider
module.exports = AppMiddlewareProvider

0 comments on commit 92cf2f8

Please sign in to comment.