Dne 04. 12. 2012 16:31, piše Sebastian Nozzi:
> With "URL mapping" I mean to variables/parameters, like:
>
> /blog/post/{id}/{slur}
>
> respondWithPost: id slur: slur
> ^ 'html for post'
>
> Since I see you are involved with Aida... can Aida do something like
> that? I am not much familiar with it...
Aida has a pluggable router so you can plug your own routing scheme
besides default ones. I'd implement your example in something like these
steps:
1. create a standalone App class, say MyBlogApp, as a subclass of
WebApplication
2. register it in a router:
AIDASite default router
addRoutePattern: '/blog/post/*'
handler: MyBlogApp new
3. create #resouceFor: method in MyBlogApp to return itself
4. continue writing the standard Aida way by implementing #viewMain etc.
5. extracting {id} and {slur} part by accessing the url of the last request:
self session lastRequest urlString
... and so on.
To ease all of this we can add an additional routing functionality to
Aida to be available by default, after collecting some experience, how
is the best way to do this. If you are interested to help ... :)
Best regards
Janko
>
> Best regards,
> Sebastian
>
>
> 2012/12/4 Sebastian Nozzi <[email protected]>:
>> Hi Janko,
>>
>> well, what I am looking for is:
>>
>> * "nice" URLs (without Seaside-like session/callback query-parameters)
>> * simple URL mapping
>> * helping functionality (for dealing with query-params, cookies,
>> setting/getting HTTP headers, etc.)
>>
>> Let's say for implementing a blog, or a simple web-page with basic
>> nagivation. Don't think I need more at the moment.
>>
>> Best regards,
>> Sebastian
>>
>> 2012/12/4 Janko Mivšek <[email protected]>:
>>> Hi Sebastian,
>>>
>>> Dne 02. 12. 2012 23:50, piše Sebastian Nozzi:
>>>> Hello,
>>>>
>>>> before I roll-out my own solution, I thought I should ask:
>>>>
>>>> Are you aware of a Sinatra-like web-framework for Pharo?
>>>>
>>>> http://www.sinatrarb.com/
>>>>
>>>> Or can Zinc-HTTP do that more or less out-of-the-box?
>>>
>>> What are your primary expectations? Simplicity, REST, flexibility, for
>>> what kind of web apps?
>>>
>>> Best regards
>>> Janko
--
Janko Mivšek
Aida/Web
Smalltalk Web Application Server
http://www.aidaweb.si