aesteve / grooveex Goto Github PK
View Code? Open in Web Editor NEWExtension module for vertx-groovy adding methods and syntaxic sugar
License: Apache License 2.0
Extension module for vertx-groovy adding methods and syntaxic sugar
License: Apache License 2.0
render
on RoutingContext
static pass(RoutingContext self) {
self.next()
}
RoutingContext => ctx.getVertx().eventBus()
gerEventBus() and gerVertx() should be defined everywhere possible
Use RouterBuilder from https://github.com/aesteve/vertx-web-groovy-dsl
43min : http://www.infoq.com/presentations/groovy-dsl-2015
(helps with IDE support)
Also try to use @ClosureParams
as a groovy enhancement to RoutingContextExtension
use first marshaller in list
User story :
router {
route('/api/multi') {
get | post | patch {
// do some stuff
}
get {
// handle get
}
post {
// handle post
}
// ...
}
}
http://www.infoq.com/presentations/groovy-dsl-2015 1h03
"Let the compiler know that a missing method or attribute is OK, or not".
Example : "if you find a method call which has the name of an http method, it's OK"
http://www.infoq.com/presentations/groovy-dsl-2015
1h00
The spec is immutable and can be used as a delegate (see #7 ), the builders extends
the spec.
User story :
router {
route('/api/members') {
consumes 'application/json'
produces 'application/json'
get {
// return all members
}
post {
// create member
}
get('/:memberId') {
// find member by id
}
}
}
Within RouteDSL.methodMissing if httpmethod, then watch parameter number, if String as first parameter, add to path.
For now, extensions are added as first handlers. It's probably gonna be needed to attach extension handlers after the actual routing method is invoked.
User story :
router {
extension('dateBefore') { header -> { ctx -> ctx.request.headers[header] = new Date().time } }
route('/api/treatment') {
dateHeader 'X-Date-Before'
get {
doSomeLongStuff()
it++
}
dateHeader 'X-Date-After'
}
}
Not sure it's possible to write it this way, but... At least provide the functionnality in some way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.