As another option for 2.0 I've put together a Thymeleaf based template
engine:
https://github.com/swilliams-vmw/mod-thymeleaf
Module name (currently in OSS Sonatype Maven Snapshot repo):
io.vertx~mod-thymeleaf~1.0.0-SNAPSHOT
p
> On Thu, Apr 25, 2013 at 10:54 AM, Paulo Lopes <
pml...@gmail.com
> <mailto:
pml...@gmail.com>> wrote:
>
> I didn't know about ratpack.
>
> Well it looks like the API is somehow close.
>
> I am not planning to build something like ratpack, however if
> someone invests some time building say:
>
> * render engines
> * session middleware
> * more stuff missing...
>
> The current middleware list can do most of the tasks ratpack can.
>
> One feature that RatPack has is template engine, to demonstrate how
> Yoke can be extended in that area, I implemented a simple render
> engine that does property placeholder replacement.
>
> Given the template: /"Hello ${name}!"/ and a map /{name: "world"}/
> it renders to /"Hello world!"/
>
> It is even smart to do interpolation such as: /"Hello ${na${me}}!"/
> and /{name: "world", me: "me"}/ it renders /"Hello world!"/
>
> The render engine is also used in the example application (KitCMS)
> for everyone interested in knowing how to use it.
>
> About groovy support i cannot guarantee that it is good enough since
> I do not have much experience with the language, I created the basic
> bindings but if there is someone with better knowledge of the
> language, feel free to refactor the whole thing :)
>
> On Thursday, April 25, 2013 11:50:37 AM UTC+2, Tim Fox wrote:
>
> Great! I think it would be great to have good Groovy support.
>
> Btw, have you seen
https://github.com/ratpack/__ratpack
>>
https://github.com/pmlopes/__yoke/tree/master/example/__groovy
>> import com.jetdrone.vertx.yoke.__middleware.*
>> def yoke = new GYoke(vertx)
>>
>> yoke.use(new ErrorHandler(true))
>>
>> yoke.use() { request, next ->
>>
>> if (request.path() == '/hello') {
>>
>> request.response().end__('Hi there!')
>> Favicon.class.getResource("__favicon.ico").getPath()
>>
>> does not return an actual filesystem path but
>> instead a value like.
>>
>> /D:/vertx/test-yoke/mods/com.__jetdrone~yoke~1.0.0-SNAPSHOT/__com/jetdrone/vertx/yoke/__middleware/favicon.ico
>>
>> where the initial "/" char means the path can
>> not by opened with the fileSystem() classes.
>>
>>
>>
>>
>>
>> Den fredag den 19. april 2013 11.26.49
>> <tel:2013%2011.26.49> UTC+2 skrev Paulo Lopes:
>>
>> *Yoke*
>>
>> Yoke is a project that I've been working
>> on for the last couple of weeks.
>>
>> The purpose of Yoke is to provide a easy
>> way to build web applications or web
>> frameworks on top of Vert.x with a simple API.
>>
>> Yoke has no external dependencies, however
>> it is meant to be extended.
>>
>> Yoke is a chain executor framework for
>> Vert.x, it was modeled after Connect (see
>>
http://www.senchalabs.org/__connect/
>> <
http://www.senchalabs.org/connect/>) and
>> right now is bundled with 12 middleware
>> components and if you are interested you
>> can write 3rd party middlewares to be
>> added to the project.
>>
>> *Usage*
>>
>> The usage at the moment is Java only and I
>> am planning to create bindings for other
>> languages that run on Vert.x.
>>
>> import com.jetdrone.vertx.yoke.__middleware.*;
>> import org.vertx.java.core.Handler;
>> import
>> org.vertx.java.core.http.__HttpServerRequest;
>> import org.vertx.java.platform.__Verticle;
>> *Installation*
>>
>> Just pull the jar to your module lib. I am
>> in the process of uploading the artifact
>> to maven central.
>>
>> *Bundled Middleware*
>>
>> * *BasicAuth* - basic http authentication
>> * *BodyParser* - extensible request body
>> parser, internally it will parse the
>> request body and populate the field
>> body on the HttpServerRequest object
>> with either:
>> o *JsonObject* if content-type was
>> application/json
>> o *Map<String, Object>* if
>> content-type was
>> application/x-www-form-__urlencoded
>> o *Map<String, Object>* plus field
>> files (Map<String, UploadFile>) if
>> content-type was multipart/form-data
>> * *CookieParser* - populates the field
>> cookies on the request and verifies if
>> they are signed
>> * *ErrorHandler* - Pretty error messages
>> either in html/json/text
>> * *Favicon* - generate a proper
>> favicon.ico for your app
>> * *Limit* - Limit the request body to a
>> specific amount of bytes
>> * *MethodOverride* - faux HTTP method
>> support
>> * *ResponseTime* - calculates
>> response-time and exposes via
>> X-Response-Time
>> * *Router* - Route Matcher like Vertx
>> one but allows also responses to be
>> chainable
>> * *Static* - static file server (with
>> proper caching headers) and optional
>> directory listing
>> * *Timeout* - request timeouts do not
>> allow long running requests
>> * *Vhosts* - virtual host sub-domain
>> mapping middleware
>>
>>
>> *Links*
>>
>> * github -
>>
https://github.com/pmlopes/__yoke
>> <
https://github.com/pmlopes/yoke>
>> * lib -
http://pmlopes.github.io/yoke
>>
>>
>> --
>> You received this message because you are subscribed to the
>> Google Groups "vert.x" group.
>> To unsubscribe from this group and stop receiving emails from
>> it, send an email to vertx+un...@__
googlegroups.com.
>>
>> For more options, visit
>>
https://groups.google.com/__groups/opt_out
>> <
https://groups.google.com/groups/opt_out>.
> <mailto:
vertx%2Bunsu...@googlegroups.com>.
> mailto:
bmros...@gmail.com <mailto:
bmros...@gmail.com>
>
> "Treat people as they ought to be, and you will help them
> become what they are capable of being." - Goethe
>
[key:62590808]