Handling many routes in Sinatra

994 views
Skip to first unread message

Akmuhammet J.

unread,
Aug 6, 2012, 9:49:24 AM8/6/12
to sina...@googlegroups.com
Hi folks,

We are wriring API server using Sinatra.
Obviously we need to define a lot of routes. We have a lot of models
where each of them needs RESTful operations. 
Basically what is the best practices to manage huge amount of routes. 
I believe keeping all route definitions in one file is not a good approach.

Any well-written open similar source projects I can have a look at?

Akmuhammet J.

Richard Conroy

unread,
Aug 6, 2012, 11:28:45 AM8/6/12
to sina...@googlegroups.com
You could try Grape, a gem for specifically putting REST APIs on models.


Akmuhammet J.

--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To post to this group, send email to sina...@googlegroups.com.
To unsubscribe from this group, send email to sinatrarb+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sinatrarb?hl=en.



--

Konstantin Haase

unread,
Aug 6, 2012, 11:52:37 AM8/6/12
to sina...@googlegroups.com
Different approaches:

  • Just split up the files (can get messy soon, too) and load those files.
  • Use sinatra-namespace (though this is more for organizing larger files).
Cheers,
Konstantin
 


Konstantin Haase wrote:
Different approaches:

  • Just split up the files (can get messy soon, too) and load those files.
  • Use sinatra-namespace (though this is more for organizing larger files).
Cheers,
Konstantin

Konstantin Haase

unread,
Aug 6, 2012, 11:30:34 AM8/6/12
to sina...@googlegroups.com
Different approaches:

  • Just split up the files (can get messy soon, too) and load those files.
  • Use sinatra-namespace (though this is more for organizing larger files).
Cheers,
Konstantin

August 6, 2012 3:49 PM

Ed Drain

unread,
Aug 7, 2012, 1:09:06 AM8/7/12
to sina...@googlegroups.com
You might want to have a look at Padrinorb.  Padrino lets you have routes defined in multiple controllers.


Akmuhammet J.

--
Reply all
Reply to author
Forward
0 new messages