-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
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
several changes #127
several changes #127
Conversation
fa70e70
to
4f06b81
Compare
also rewrites writeFile to take a filename instead of a file descriptor.
It can use the same (or different) files from the web root and will send them as downloads to the browser. See the example updates.
It's just an amazing contribution! It'll be the perfect release of the Pegasus v1! 👍 |
I have a few more changes to make before a 1.0, but it’s shaping up nicely |
It looks great @Tieske! |
preferably I'd like #131 as well in the 1.0 version. But I'd like your opinion on the following; should the router be a plugin, or should the router replace the handler? Personally I think the latter, since each router-path should probably get its own plugins. |
@Tieske IMO it's not the responsibility of the HTTP server to implement the router. Ideally, a framework or plugin should be responsible for a router implementation as it's more of a high-level thing. I'm open to changing my opinion, though :) |
Lapis is an example. with a router you typically want specific plugins on specific paths. Eg.
Now how would this work if the router itself is a plugin? If the router is implemented in the handler, then it could simply default to a route "/" with the "files" plugin first, and a callback as fallback. That would retain the current handler functionality. |
@Tieske IMO Lapis is not the best example, as they are not an HTTP server but a web framework. |
Good point. So that means that a router should be either an additional Would the former be acceptable; a second "handler" implementing a router? if not, how did you envision #50 to be implemented? |
@Tieske I think we could make it available as part of the plugin structure of Pegasus. WDYT? Would you happen to have any other suggestions for it? |
can you elaborate on what you mean by "we could make it available as part of the plugin structure of Pegasus"? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
@Tieske, let's move the discussion about the Router to the proper PR. |
closes #51
closes #36