Skip to main content Link Search Menu Expand Document (external link)

ServerRequest overview

Added in v1.0.0


Table of contents


accessors

persistedMultipart

Signature

export declare const persistedMultipart: Effect.Effect<
  Scope.Scope | Path.Path | FileSystem.FileSystem | ServerRequest,
  Multipart.MultipartError,
  unknown
>

Added in v1.0.0

context

ServerRequest

Signature

export declare const ServerRequest: Context.Tag<ServerRequest, ServerRequest>

Added in v1.0.0

conversions

fromWeb

Signature

export declare const fromWeb: (request: Request) => ServerRequest

Added in v1.0.0

fiber refs

maxBodySize

Signature

export declare const maxBodySize: FiberRef<Option<FileSystem.Size>>

Added in v1.0.0

models

ServerRequest (interface)

Signature

export interface ServerRequest extends IncomingMessage.IncomingMessage<Error.RequestError> {
  readonly [TypeId]: TypeId
  readonly source: unknown
  readonly url: string
  readonly originalUrl: string
  readonly method: Method

  readonly multipart: Effect.Effect<
    Scope.Scope | FileSystem.FileSystem | Path.Path,
    Multipart.MultipartError,
    Multipart.Persisted
  >
  readonly multipartStream: Stream.Stream<never, Multipart.MultipartError, Multipart.Part>

  readonly modify: (options: {
    readonly url?: string
    readonly headers?: Headers.Headers
    readonly remoteAddress?: string
  }) => ServerRequest
}

Added in v1.0.0

schema

schemaBodyForm

Signature

export declare const schemaBodyForm: <I extends Multipart.Persisted, A>(
  schema: Schema.Schema<I, A>
) => Effect.Effect<
  Scope.Scope | Path.Path | FileSystem.FileSystem | ServerRequest,
  ParseResult.ParseError | Multipart.MultipartError | Error.RequestError,
  A
>

Added in v1.0.0

schemaBodyFormJson

Signature

export declare const schemaBodyFormJson: <I, A>(
  schema: Schema.Schema<I, A>
) => (
  field: string
) => Effect.Effect<
  Scope.Scope | Path.Path | FileSystem.FileSystem | ServerRequest,
  ParseResult.ParseError | Error.RequestError,
  A
>

Added in v1.0.0

schemaBodyJson

Signature

export declare const schemaBodyJson: <I, A>(
  schema: Schema.Schema<I, A>
) => Effect.Effect<ServerRequest, ParseResult.ParseError | Error.RequestError, A>

Added in v1.0.0

schemaBodyMultipart

Signature

export declare const schemaBodyMultipart: <I extends Multipart.Persisted, A>(
  schema: Schema.Schema<I, A>
) => Effect.Effect<
  Scope.Scope | Path.Path | FileSystem.FileSystem | ServerRequest,
  ParseResult.ParseError | Multipart.MultipartError,
  A
>

Added in v1.0.0

schemaBodyUrlParams

Signature

export declare const schemaBodyUrlParams: <I extends Readonly<Record<string, string>>, A>(
  schema: Schema.Schema<I, A>
) => Effect.Effect<ServerRequest, ParseResult.ParseError | Error.RequestError, A>

Added in v1.0.0

schemaHeaders

Signature

export declare const schemaHeaders: <I extends Readonly<Record<string, string>>, A>(
  schema: Schema.Schema<I, A>
) => Effect.Effect<ServerRequest, ParseResult.ParseError, A>

Added in v1.0.0

type ids

TypeId

Signature

export declare const TypeId: typeof TypeId

Added in v1.0.0

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v1.0.0