5 ms·
I was just checking the Sinatra docs and the Juno examples on the homepage. Suppose I want to do mydomain.com/username, Sinatra supports doing: get '/:name' d
by SingAlong 18y ago
I was just checking the Sinatra docs and the Juno examples on the homepage.
Suppose I want to do mydomain.com/username,
Sinatra supports doing:
get '/:name' do
#matches /username
end
but in Juno the route is set earlier itself, and hence seems like can't be done without a controller name (as it's called in cakephp)
@route('/hello/:name/')
def hello(web, name):
return 'Hello, %s' % name
Or if I'm wrong... can I do this?
@route('/:name/')
def index(web, name):
return 'Hello, %s' % name
Also, i've been used to PHP and would like to use Django or Juno or Sinatra or Rails or anyother language's framework. But the thing that puts me off is how do I start the webserver when using Sinatra or Django?
P.S: I love the routing system in Sinatra and Juno. Too friendly and no tinkering with regex directly