Comments (6)
I don't really like the '/get/:id' syntax.
this seems cleaner:
map(':id', :methods => [:get]) do |env|
# ...
end
map(':id', :methods => [:post, :put]) do |env|
# ...
end
map(':id') do |env|
# ... catches all remaining ...
end
flip
On Fri, May 20, 2011 at 7:20 PM, gregwebs <
[email protected]>wrote:
Asked on the group mail list:
One possibility is this gist for trying to integrate with a rack router:
https://gist.github.com/891804
But it isn't clear how to use this when there a multiple routes,
particularly when there is a need to include different middleware for
different routes.Currently I look at the REQUEST_METHOD, but I lose the ability to have
different middleware configurations for different methods.Reply to this email directly or view it on GitHub:
#53
infochimps.com - discover data
from goliath.
For what its worth, I'd be in favor of looking at how to integrate existing routing gems, instead of trying to reinvent the wheel.
from goliath.
Hi, my name is Max.
I too would like to simplify my request routing through Goliath.
My two cents: Of all the routing gems I've found, I've held two for consideration:
- http_router by Joshua Hull
- rack_mount by Josh Peek
I'll look into how they can fit in and what they are worth.
Let me know if one of you is already prototyping this.
from goliath.
I have been playing with goliath with Rack::Builder routes and Rack::Router, I think it provide a viable solution for more Restful routing but leave me to want more.
It would be nice if Goliath::Runner can bootstrap Sinatra-Syncrhony like the "customer_server.rb" example, Sinatra does what it does best with simple restful routing where as goliath API for heavy event driven end point
https://github.com/postrank-labs/goliath/blob/master/examples/custom_server.rb
runner = Goliath::Runner.new(ARGV, nil)
runner.app = Sinatra::Application
runner.run
Thanks igrigorik, you are awesome :)
from goliath.
I've put together a quick gist in the past with http_router example: https://gist.github.com/891804
I did run into some issues with more advanced http_router examples. /cc @joshbuddy
from goliath.
Josh committed sinatra-like support - check latest commits.
from goliath.
Related Issues (20)
- Does coerce still work?
- Validation Errors for Required Params are not a valid format HOT 4
- require grape slow down app HOT 5
- What's the purpose of Goliath.run_app_on_exit = true ? HOT 3
- Error after adding goliath to my Gemfile. HOT 4
- Getting issues in app due to lock/ compatibility between ruby 2.0.0 and goliath 1.0.3 HOT 2
- EM dependency too permissive HOT 9
- 1.0.5 release HOT 14
- Please join us in implementing Websockets for Rack HOT 1
- Store env in thread-local variable HOT 1
- Goliath JSON middleware incompatible with JSONAPI HOT 2
- Params middleware only parses params for `application/json` HOT 1
- How to stream content through a Goliath app? HOT 7
- Accessing the EventMachine connection? HOT 5
- Change message "An error happened"
- Sending response before all request data was received HOT 1
- Rack 2.x
- HTTP Request Smuggling Hardening
- Security Notice & Bug Bounty - HTTP Request Smuggling - huntr.dev HOT 1
- How to set allowed duplicated headers in Http Response HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goliath.