use of com.nexblocks.authguard.rest.server.AuthGuardServer in project AuthGuard by AuthGuard.
the class TestServer method start.
void start() {
authGuardServer = new AuthGuardServer(injector);
this.port = app.port();
authGuardServer.start(app, app.port());
}
use of com.nexblocks.authguard.rest.server.AuthGuardServer in project AuthGuard by AuthGuard.
the class ServerRunner method run.
public void run(final ConfigContext configContext) {
// class search
final Collection<String> searchPackages = configContext.getSubContext("injection").getAsCollection("packages", String.class);
final ClassSearch classSearch = new ClassSearch(searchPackages);
// injectors
final Injector injector = Guice.createInjector(new MappersBinder(), new ConfigBinder(configContext), new ExchangesBinder(configContext, searchPackages), new ApiKeysExchangeBinder(configContext, searchPackages), new ApiRoutesBinder(searchPackages, configContext), new ServicesBinder(configContext), new JwtBinder(configContext), new DalBinder(configContext, searchPackages), new EmbBinder(searchPackages), new ExternalProvidersBinder(configContext, searchPackages));
log.info("Initialed injection binders");
// run bootstraps
new BootstrapRunner(classSearch, injector).runAll();
log.info("Completed bootstrap");
// run the server
final ImmutableServerConfig serverConfig = Optional.ofNullable(configContext.getAsConfigBean("server", ImmutableServerConfig.class)).orElseGet(() -> ImmutableServerConfig.builder().port(3000).build());
new AuthGuardServer(injector).start(Javalin.create(config -> {
config.enforceSsl = serverConfig.enforceSsl();
config.server(() -> new JettyServerProvider(serverConfig).get());
config.accessManager(new RolesAccessManager());
}));
}
Aggregations