use of org.qi4j.samples.forum.assembler.ForumAssembler in project qi4j-sdk by Qi4j.
the class Main method main.
public static void main(String[] args) throws Exception {
Energy4Java is = new Energy4Java();
Server server = new Server(Protocol.HTTP, 8888);
Application app = is.newApplication(new ForumAssembler(), new MetadataService());
app.activate();
ContextRestlet restlet = app.findModule("REST", "Restlet").newObject(ContextRestlet.class, new org.restlet.Context());
ChallengeAuthenticator guard = new ChallengeAuthenticator(null, ChallengeScheme.HTTP_BASIC, "testRealm");
MapVerifier mapVerifier = new MapVerifier();
mapVerifier.getLocalSecrets().put("rickard", "secret".toCharArray());
guard.setVerifier(mapVerifier);
guard.setNext(restlet);
server.setNext(restlet);
server.start();
}
Aggregations