public static Registry buildBaseRegistry(Stopper stopper, LaunchConfig launchConfig) {
ErrorHandler errorHandler = launchConfig.isDevelopment() ? new DefaultDevelopmentErrorHandler() : new DefaultProductionErrorHandler();
RegistryBuilder registryBuilder = Registries.registry()
.add(Stopper.class, stopper)
.add(MimeTypes.class, new ActivationBackedMimeTypes())
.add(PublicAddress.class, new DefaultPublicAddress(launchConfig.getPublicAddress(), launchConfig.getSSLContext() == null ? HTTP_SCHEME : HTTPS_SCHEME))
.add(Redirector.class, new DefaultRedirector())
.add(ClientErrorHandler.class, errorHandler)
.add(ServerErrorHandler.class, errorHandler)
.add(LaunchConfig.class, launchConfig)