We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What: Make server level middleware accept functions and drop current implementation.
Why: Keeping a standard for all middlewares (see #186).
// ---------- Previous class ServerMiddleware extends Drash.Http.Middleware { public run() { console.log(`server middleware with ${this.request}${this.response}`); } } const server = new Drash.Http.Server({ resources: [HomeResource], middleware: { before_request: [ServerMiddleware], after_request: [ServerMiddleware] } }); // ---------- Feature function SyncServerMiddleware(req: any, response: Drash.Http.Response) { console.log(`server middleware with ${request}${response}`); } async function AsyncServerMiddleware(req: any, response: Drash.Http.Response) { console.log(`server middleware with ${request}${response}`); } const server = new Drash.Http.Server({ resources: [HomeResource], middleware: { before_request: [SyncServerMiddleware], after_request: [AsyncServerMiddleware] } });
The text was updated successfully, but these errors were encountered:
Merge pull request #204 from Guergeiro/standardize-middlewares
8e80e7a
Issue #200 Standardize Middlewares
Guergeiro
Successfully merging a pull request may close this issue.
Summary
What: Make server level middleware accept functions and drop current implementation.
Why: Keeping a standard for all middlewares (see #186).
Acceptance Criteria
Example Pseudo Code (for implementation)
The text was updated successfully, but these errors were encountered: