Skip to content

Instantly share code, notes, and snippets.

View abdielou's full-sized avatar

Abdiel Aviles abdielou

View GitHub Profile
@abdielou
abdielou / server.groovy
Created June 23, 2016 15:03
Where NOT to set the router BodyHandler
import io.vertx.core.http.HttpMethod
import io.vertx.groovy.ext.web.Router
import io.vertx.groovy.ext.web.handler.BodyHandler
def router = Router.router(vertx)
router.route().handler(BodyHandler.create()) // This works when defined before the routes
def route = router.route(HttpMethod.POST,"/method")
//router.route().handler(BodyHandler.create()) // This will NOT work
route.handler { routingContext ->
@abdielou
abdielou / findAllExample.groovy
Last active November 2, 2016 21:29
Example on how to find more than 1k items with a ParseQuery. The unavoidable hard limit is 10k items as defined by Parse.
/**
* Created by abdielou on 11/2/16.
*/
class FindAllExtension{
public static def findAll(ParseQuery query){
def allItems = []
def limit = 1000
def page = 0
def currSize = 0