public class GYoke
extends java.lang.Object
Constructor and Description |
---|
GYoke(org.vertx.groovy.core.Vertx vertx)
Creates a Yoke instance.
|
Modifier and Type | Method and Description |
---|---|
GYoke |
engine(java.lang.String extension,
Engine engine)
Adds a Render Engine to the library.
|
GYoke |
listen(org.vertx.groovy.core.http.HttpServer gserver)
Starts listening at a already created server.
|
GYoke |
listen(int port)
Starts the server listening at a given port bind to all available interfaces.
|
GYoke |
listen(int port,
java.lang.String address)
Starts the server listening at a given port and given address.
|
GYoke |
set(java.lang.String key,
java.lang.Object value)
When you need to share global properties with your requests you can add them
to Yoke and on every request they will be available as request.get(String)
|
GYoke |
use(groovy.lang.Closure closure)
Adds a middleware to the chain with the prefix "/".
|
GYoke |
use(Middleware middleware)
Adds a middleware to the chain with the prefix "/".
|
GYoke |
use(java.lang.String route,
groovy.lang.Closure closure)
Adds a Middleware to the chain.
|
GYoke |
use(java.lang.String route,
Middleware middleware)
Adds a Middleware to the chain.
|
public GYoke(org.vertx.groovy.core.Vertx vertx)
vertx
- The Vertx instancepublic GYoke use(java.lang.String route, groovy.lang.Closure closure)
route
- The route prefix for the middlewareclosure
- The closure add to the chainpublic GYoke use(groovy.lang.Closure closure)
closure
- The closure add to the chainYoke.use(String, Middleware)
public GYoke use(java.lang.String route, Middleware middleware)
route
- The route prefix for the middlewaremiddleware
- The middleware add to the chainpublic GYoke use(Middleware middleware)
middleware
- The middleware add to the chainYoke.use(String, Middleware)
public GYoke engine(java.lang.String extension, Engine engine)
extension
- The file extension for this template engine e.g.: .jspengine
- The implementation of the enginepublic GYoke set(java.lang.String key, java.lang.Object value)
key
- unique identifiervalue
- Any non null value, nulls are not savedpublic GYoke listen(int port)
port
- the server TCP portpublic GYoke listen(int port, java.lang.String address)
port
- the server TCP portpublic GYoke listen(org.vertx.groovy.core.http.HttpServer gserver)