Search in sources :

Example 6 with ActualHttpServer

use of com.github.dreamhead.moco.internal.ActualHttpServer in project moco by dreamhead.

the class SessionSetting method newHttpServer.

public ActualHttpServer newHttpServer(final int port, final MocoConfig[] configs) {
    if (isResource()) {
        ActualRestServer server = new ActualRestServer(port, null, 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)

Aggregations

ActualHttpServer (com.github.dreamhead.moco.internal.ActualHttpServer)6 RestSetting (com.github.dreamhead.moco.RestSetting)2 SessionSetting (com.github.dreamhead.moco.parser.model.SessionSetting)2 ActualRestServer (com.github.dreamhead.moco.rest.ActualRestServer)2