antoineroux / vert.x-jersey

Integrates Jersey JAX-RS implementation with Vert.x application framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This project provides a simple integration between Vert.x and Jersey (JAX-RS implementation).

Here is an example of how you can use it. For instance, if you want to make your REST resources in the package com.example.resources accessible from /api:

public class Demo implements VertxApp {
    
    public void start() {
        RouteMatcher rm = new RouteMatcher();

        try {
            rm.all(
                "/api/.*", 
                new RestHandler(new URI("http://localhost:8080/api/")), 
                "com.example.resources");
        } catch (URISyntaxException e) {
            // Exceptions are currently not handled by the project.
            e.printStackTrace();
        }        
        
        server = new HttpServer().requestHandler(rm).listen(8080);
    }
}

About

Integrates Jersey JAX-RS implementation with Vert.x application framework


Languages

Language:Shell 56.4%Language:Java 34.9%Language:Groovy 8.7%