Skip to content

Instantly share code, notes, and snippets.

@gchatelet
Created March 12, 2013 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gchatelet/5147036 to your computer and use it in GitHub Desktop.
Save gchatelet/5147036 to your computer and use it in GitHub Desktop.
import org.restlet.Application;
import org.restlet.Server;
import org.restlet.data.Protocol;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
public class SimpleServer extends Application {
public static void main(String[] args) throws Exception {
new Server(Protocol.HTTP, 8111, GreetingResource.class).start();
}
public static class GreetingResource extends ServerResource {
@Get
public String getHello() {
return "Hello, " + getQueryValue("input");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment