Created
March 12, 2013 21:07
-
-
Save gchatelet/5147036 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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