Git Product home page Git Product logo

Comments (6)

mrflip avatar mrflip commented on June 16, 2024

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:

http://groups.google.com/group/goliath-io/browse_thread/thread/c1de2c3436cb87ef/99334bf46f515e59?lnk=gst&q=RESTful#99334bf46f515e59

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.

igrigorik avatar igrigorik commented on June 16, 2024

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.

ximus avatar ximus commented on June 16, 2024

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:

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.

speedmax avatar speedmax commented on June 16, 2024

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.

igrigorik avatar igrigorik commented on June 16, 2024

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.

igrigorik avatar igrigorik commented on June 16, 2024

Josh committed sinatra-like support - check latest commits.

from goliath.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.