GithubHelp home page GithubHelp logo

aesteve / grooveex Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 1.0 305 KB

Extension module for vertx-groovy adding methods and syntaxic sugar

License: Apache License 2.0

Groovy 99.99% HTML 0.01%
async dsl groovy vertx vertx-web

grooveex's People

Contributors

aesteve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

thanhvc

grooveex's Issues

pass

static pass(RoutingContext self) {
  self.next()
}

Compose http methods

User story :

router {
  route('/api/multi') {
    get | post | patch {
      // do some stuff
    }
    get {
      // handle get
    }
    post {
      // handle post
    }
    // ...
  }
}
  • find a way to write it nicely
  • implement it

Add String parameter to get, post, ... within route

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.

Run extensions before or after the actual routing method is invoked

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.