Hyperlinkv0.8.0-beta.28

NodeHttpServer

(
  evaluate: LazyArg<Http.Server>,
  options: Config.Wrap<
    Net.ListenOptions & {
      readonly disablePreemptiveShutdown?: boolean | undefined
      readonly gracefulShutdownTimeout?: Duration.Input | undefined
    }
  >
): Layer.Layer<
  | HttpServer.HttpServer
  | NodeServices.NodeServices
  | HttpPlatform.HttpPlatform
  | Etag.Generator,
  ServeError | Config.ConfigError
>

Provides a Node HttpServer together with the Node HTTP platform, ETag, and core Node platform services, reading the listen and shutdown options from a Config value.

layers
export const layerConfig = (
  evaluate: LazyArg<Http.Server>,
  options: Config.Wrap<
    Net.ListenOptions & {
      readonly disablePreemptiveShutdown?: boolean | undefined
      readonly gracefulShutdownTimeout?: Duration.Input | undefined
    }
  >
): Layer.Layer<
  HttpServer.HttpServer | NodeServices.NodeServices | HttpPlatform.HttpPlatform | Etag.Generator,
  ServeError | Config.ConfigError
> =>
  Layer.mergeAll(
    Layer.effect(HttpServer.HttpServer)(
      Effect.flatMap(Config.unwrap(options), (options) => make(evaluate, options))
    ),
    layerHttpServices
  )