Zesty-Router Docs¶
Zesty is a creative JavaScript wrapper around the Jetty web server. It works out-of-the-box with the servlet 3.0 API which enables handling requests in asynchronous fashion. Note that the servlet 3.1 API on the other hand, introduces new interfaces to handle asynchronous socket I/O for which there isn’t an idiomatic way to handle generically in zesty yet. However, using either Javascript or Java with zesty is handled using a uniform and easy to understand API.
- AppServer Object
- AppProvider Object
- HandlerConfig Object
- BodyWriter Object
- BodyReader Object
- Configure Logging
- AppRoutes Object
- HandlerRequest Object
- protocol() : String
- secure() : boolean
- hostname() : String
- ip() : String
- path() : String
- route() : RouteSearch
- param(name: String) : String
- pathParams() : Map
- query() : String
- header(name: String) : String
- error() : boolean
- message() : String
- body() : byte[]
- body(type: Class) : T
- body(provider: BodyReader) : T
- capture() : long
- upload(destination: String) : long
- cookies() : Cookie[]
- session(create: boolean) : HttpSession
- HandlerResponse Object
- header(header: String, value: String) : void
- templates(folder: String) : void
- context(ctx: String): void
- status(status: int) : void
- sendStatus(status: int) : void
- end(payload: String) : void
- json(payload: Object) : void
- jsonp(payload: Object) : void
- xml(payload: Object, template: Class) : void
- content(payload: T, writer: BodyWriter) : void
- render(template: String, model: Map) : void
- next(path: String) : void
- redirect(path: String) : void
- redirect(status: int, path: String) : void
- type(mimetype: String) : void
- cookie(name: String, value: String) : void
- attachment(filename: String) : void
- download(path: String, filename: String, mimeType: String, status: HandlerStatus) : void
- getContent() : byte[]
- App Functions
- status() : String
- appctx(path: String) : void
- assets(path: String) : void
- engine(String view) : void
- resolve(path: String) : String
- locals() : Set<String>
- locals(param: String) : Object
- cors(params: Map) : AppServer
- router() : AppServer
- router(supplier: Supplier) : AppServer
- filter(filter: HandlerFilter) : AppServer
- filter(context: String, filter: HandlerFilter) : AppServer
- route(method: String, path: String, handler: HandlerServlet) : AppServer
- route(method: String, path: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- head(path: String, handler: HandlerServlet) : AppServer
- head(path: String, handler: BiFunction) : AppServer
- head(path: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- head(path: String, config: HandlerConfig, handler: BiFunction) : AppServer
- head(path: String, accept: String, type: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- trace(path: String, handler: HandlerServlet) : AppServer
- trace(path: String, handler: BiFunction) : AppServer
- trace(path: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- trace(path: String, config: HandlerConfig, handler: BiFunction) : AppServer
- trace(path: String, accept: String, type: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- options(path: String, handler: HandlerServlet) : AppServer
- options(path: String, handler: BiFunction) : AppServer
- options(path: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- options(path: String, config: HandlerConfig, handler: BiFunction) : AppServer
- options(path: String, accept: String, type: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- get(path: String, handler: HandlerServlet) : AppServer
- get(path: String, handler: BiFunction) : AppServer
- get(path: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- get(path: String, config: HandlerConfig, handler: BiFunction) : AppServer
- get(path: String, accept: String, type: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- post(path: String, handler: HandlerServlet) : AppServer
- post(path: String, handler: BiFunction) : AppServer
- post(path: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- post(path: String, config: HandlerConfig, handler: BiFunction) : AppServer
- post(path: String, accept: String, type: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- put(path: String, handler: HandlerServlet) : AppServer
- put(path: String, handler: BiFunction) : AppServer
- put(path: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- put(path: String, config: HandlerConfig, handler: BiFunction) : AppServer
- put(path: String, accept: String, type: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- delete(path: String, handler: HandlerServlet) : AppServer
- delete(path: String, handler: BiFunction) : AppServer
- delete(path: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- delete(path: String, config: HandlerConfig, handler: BiFunction) : AppServer
- delete(path: String, accept: String, type: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- all(path: String, handler: HandlerServlet) : AppServer
- all(path: String, handler: BiFunction) : AppServer
- all(path: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- all(path: String, config: HandlerConfig, handler: BiFunction) : AppServer
- all(path: String, accept: String, type: String, config: HandlerConfig, handler: HandlerServlet) : AppServer
- websocket(ctx: String, provider: AppWsProvider) : AppServer
- wordpress(home: String, fcgi_proxy: String) : AppServer
- listen(port: int, host: String) : void
- listen(port: int, host: String, result: Consumer) : void
- lifecycle(event: String, callback: Consumer) : AppServer
- App Examples
- WordPress Example
- WebSocket Example
- License
- Need more help?