Skip to content

Commit

Permalink
Apply "Move middleware configuration in the right spot finally" feath…
Browse files Browse the repository at this point in the history
  • Loading branch information
kfern committed Jun 22, 2017
1 parent 86b13c9 commit de3869c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ app.use(bodyParser.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', feathers.static(app.get('public')));
// Configure other middleware (see `middleware/index.js`)
app.configure(middleware);

// Set up Plugins and providers
app.configure(hooks());
app.configure(rest());
app.configure(socketio());

// Configure other middleware (see `middleware/index.js`)
app.configure(middleware);

// Set up our services (see `services/index.js`)
app.configure(services);
// Configure a middleware for 404s and the error handler
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module.exports = function () {
const app = this; // eslint-disable-line no-unused-vars

app.use(function(req, res, next) { // eslint-disable-line no-unused-vars
//console.log(req.feathers);//undefined
req.feathers.data = 'Hello world';
req.feathers.headers = req.headers;
next();
});

Expand Down

0 comments on commit de3869c

Please sign in to comment.