HttpServer
Accessors
Signature
declare const serve: {
(): <E, R>(
httpApp: Default<E, R>,
) => Layer<never, never, HttpServer | Exclude<R, Scope | HttpServerRequest>>;
<E, R, App extends Default<any, any>>(
middleware: Applied<App, E, R>,
): (httpApp: Default<E, R>) => Layer<never, never, any>;
<E, R>(
httpApp: Default<E, R>,
): Layer<never, never, HttpServer | Exclude<R, Scope | HttpServerRequest>>;
<E, R, App extends Default<any, any>>(
httpApp: Default<E, R>,
middleware: Applied<App, E, R>,
): Layer<never, never, any>;
};serveEffect
Added in v1.0.0
Source
Signature
declare const serveEffect: {
(): <E, R>(
httpApp: Default<E, R>,
) => Effect<void, never, Scope | HttpServer | Exclude<R, HttpServerRequest>>;
<E, R, App extends Default<any, any>>(
middleware: Applied<App, E, R>,
): (httpApp: Default<E, R>) => Effect<void, never, any>;
<E, R>(
httpApp: Default<E, R>,
): Effect<void, never, Scope | HttpServer | Exclude<R, HttpServerRequest>>;
<E, R, App extends Default<any, any>>(
httpApp: Default<E, R>,
middleware: Applied<App, E, R>,
): Effect<void, never, any>;
};Address
Signature
type Address = UnixAddress | TcpAddress;addressFormattedWith
Added in v1.0.0
Source
Signature
declare const addressFormattedWith: <A, E, R>(
effect: (address: string) => Effect.Effect<A, E, R>,
) => Effect.Effect<A, E, HttpServer | R>;addressWith
Added in v1.0.0
Source
Signature
declare const addressWith: <A, E, R>(
effect: (address: Address) => Effect.Effect<A, E, R>,
) => Effect.Effect<A, E, HttpServer | R>;formatAddress
Added in v1.0.0
Source
Signature
declare const formatAddress: (address: Address) => string;logAddress
Added in v1.0.0
Source
Signature
declare const logAddress: Effect.Effect<void, never, HttpServer>;TcpAddress interface
Added in v1.0.0
Source
Signature
interface TcpAddress {
readonly _tag: "TcpAddress";
readonly hostname: string;
readonly port: number;
}UnixAddress interface
Added in v1.0.0
Source
Signature
interface UnixAddress {
readonly _tag: "UnixAddress";
readonly path: string;
}withLogAddress
Added in v1.0.0
Source
Signature
declare const withLogAddress: <A, E, R>(
layer: Layer.Layer<A, E, R>,
) => Layer.Layer<A, E, R | Exclude<HttpServer, A>>;Constructors
HttpServer
Added in v1.0.0
Source
Signature
declare const HttpServer: Tag<HttpServer, HttpServer>;Signature
declare const make: (options: {
readonly address: Address;
readonly serve: (
httpApp: App.Default<unknown>,
middleware?: Middleware.HttpMiddleware,
) => Effect.Effect<void, never, Scope.Scope>;
}) => HttpServer;Layers
layerContext
Added in v1.0.0
Source
Signature
declare const layerContext: Layer.Layer<HttpPlatform | FileSystem | Generator | Path>;layerTestClient
Added in v1.0.0
Source
Layer producing an HttpClient with prepended url of the running http server.
Signature
declare const layerTestClient: Layer.Layer<
Client.HttpClient,
never,
Client.HttpClient | HttpServer
>;Models
HttpServer interface
Added in v1.0.0
Source
Signature
interface HttpServer {
readonly [TypeId]: typeof TypeId;
readonly address: Address;
readonly serve: {
<E, R>(httpApp: Default<E, R>): Effect<void, never, Scope | Exclude<R, HttpServerRequest>>;
<E, R, App extends Default<any, any>>(
httpApp: Default<E, R>,
middleware: Applied<App, E, R>,
): Effect<void, never, Scope | Exclude<R, HttpServerRequest>>;
};
}ServeOptions interface
Added in v1.0.0
Source
Signature
interface ServeOptions {
readonly respond: boolean;
}
A Layer providing the
HttpPlatform,FileSystem,Etag.Generator, andPathservices.The
FileSystemservice is a no-op implementation, so this layer is only useful for platforms that have no file system.