Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2
waiting-for-dev/web_pipe
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
web_pipe is a builder of composable rack applications through a pipe offunctions on an immutable struct.
web_pipeplays incredibly well withhanami 2. If you want to create ahanami 2app withweb_pipe, you can take inspiration from this sample todoapplication:https://github.com/waiting-for-dev/hanami_2_web_pipe_todo_app
- Introduction
- Design model
- Building a rack application
- Plugging operations
- Using rack middlewares
- Composing applications
- Connection struct
- Overriding instance methods
- DSL free usage
- Plugs
- Testing
- Extensions
- Recipes
# config.rurequire'web_pipe'WebPipe.load_extensions(:params)classHelloAppincludeWebPipeAUTHORIZED_USERS=%w[AliceJoe]plug:htmlplug:authorizeplug:greetprivatedefhtml(conn)conn.add_response_header('Content-Type','text/html')enddefauthorize(conn)user=conn.params['user']ifAUTHORIZED_USERS.include?(user)conn.add(:user,user)elseconn.set_status(401).set_response_body('<h1>Not authorized</h1>').haltendenddefgreet(conn)conn.set_response_body("<h1>Hello#{conn.fetch(:user)}</h1>")endendrunHelloApp.new
web_pipe is in active development but ready to be used in any environment.Everyday needs are covered, and while you can expect some API changes,they won't be essential, and we'll document everything appropriately.
Bug reports and pull requests are welcome on GitHub athttps://github.com/waiting-for-dev/web_pipe.
web_pipe follows the principles ofsemantic versioning.
About
One-way pipe, composable, rack application builder
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.