Search in sources :

Example 1 with ActualRestServer

use of com.github.dreamhead.moco.rest.ActualRestServer in project moco by dreamhead.

the class SessionSetting method newHttpServer.

public ActualHttpServer newHttpServer(final Optional<Integer> port, final MocoConfig[] configs) {
    if (isResource()) {
        ActualRestServer server = new ActualRestServer(port, Optional.<HttpsCertificate>absent(), log(), configs);
        RestSetting[] settings = resource.getSettings();
        server.resource(resource.getName(), head(settings), tail(settings));
        return server;
    }
    ActualHttpServer server = ActualHttpServer.createLogServer(port, configs);
    bindTo(server);
    return server;
}
Also used : ActualRestServer(com.github.dreamhead.moco.rest.ActualRestServer) RestSetting(com.github.dreamhead.moco.RestSetting) ActualHttpServer(com.github.dreamhead.moco.internal.ActualHttpServer)

Example 2 with ActualRestServer

use of com.github.dreamhead.moco.rest.ActualRestServer in project moco by dreamhead.

the class MocoRest method restServer.

public static RestServer restServer(final int port, final MocoConfig... configs) {
    checkArgument(port > 0, "Port must be greater than zero");
    checkNotNull(configs, "Config should not be null");
    return new ActualRestServer(of(port), Optional.<HttpsCertificate>absent(), new QuietMonitor(), configs);
}
Also used : ActualRestServer(com.github.dreamhead.moco.rest.ActualRestServer) QuietMonitor(com.github.dreamhead.moco.monitor.QuietMonitor)

Aggregations

ActualRestServer (com.github.dreamhead.moco.rest.ActualRestServer)2 RestSetting (com.github.dreamhead.moco.RestSetting)1 ActualHttpServer (com.github.dreamhead.moco.internal.ActualHttpServer)1 QuietMonitor (com.github.dreamhead.moco.monitor.QuietMonitor)1