New pre:middleware hooks and support for configuring app directly #1736

Closed
JedWatson opened this Issue Oct 15, 2015 · 0 comments

Projects

None yet

1 participant

@JedWatson
Member

We're adding more hooks into the app configuration process.

New pre('hook', (req, res, next) => { ... }) middleware support:

  • static
  • bodyparser
  • session

this is in addition to pre('routes', ...), which already exists.

We also need to support hooking into the app setup directly, to allow for scoped middleware (i.e. app.use(path, middleware).

To use the configuration method rather than the hook method:

keystone.set('pre:routes', (app) => {
   app.use(middleware);
});

The configuration method is available for all hooks:

  • pre:static
  • pre:bodyparser
  • pre:session
  • pre:routes
@JedWatson JedWatson closed this in 94d73ab Oct 15, 2015
@JedWatson JedWatson referenced this issue in keystonejs/grappling-hook Oct 16, 2015
Closed

Issue with `keystone.pre('routes', middleware)` #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment