Skip to content

[feature request] some way to provide custom middleware #7

@Zydnar

Description

@Zydnar

I don't know how much would it be helpful, but it's just an idea. Between request and response is now this 'request' function$server = new HttpServer([$requestLoop, 'request']); - but if sombody would need some logger function, trigger some event, gzip response etc. now it's required to use classes from this library src and write own custom bin file. It would be simplier to provide path to php file / config file with custom middleware returning request and continue this chain to send response or if returning response break this chain. The idea definitely would make this library more elastic. The idea I took from here: https://sailsjs.com/documentation/concepts/middleware - yes it's node library but the idea to process request is the same. So my idea is to provide default config like this and if needed way to overwrite it like --custom-middleware <path>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions