Skip to content

REST support for Webbit based on JAX-WS (JSR 311)

Notifications You must be signed in to change notification settings

hnilsen/webbit-rest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webbit REST

Webbit REST brings JAX-RS (JSR-311) to Webbit. Here is a quick example:

package org.webbitserver.rest;

import org.webbitserver.WebServer;
import org.webbitserver.WebServers;
import org.webbitserver.rest.resteasy.ResteasyHandler;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

public class Main {

    @Path("/hello")
    public static class HelloResource {
        @GET
        @Produces("text/plain")
        public String get() {
            return "Hello";
        }
    }

    public static void main(String[] args) throws Exception {
        WebServer webServer = WebServers.createWebServer(9877);
        webServer.add(new ResteasyHandler(new HelloResource()));
        webServer.start();

        System.out.println("Try this: curl " + webServer.getUri() + "hello");
    }
}

Webbit-REST uses RestEasy under the hood.

About

REST support for Webbit based on JAX-WS (JSR 311)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published