uwsjs-fork (forked from uWebSockets.js) v0.0.1 documentation
    Preparing search index...

    Class DeclarativeResponse<HeadersType>

    Helper class to create static responses, bypassing JavaScript handlers entirely.

    var server = App();
    type BasicHeaders = {
    "Content-Type": `${string}/${string}`;
    [k: string]: string
    }
    server.get("/",
    new DeclarativeResponse<BasicHeaders>()
    .writeHeader("Content-Type", "application/json")
    .end('{"message": "hello world"}')
    );

    Type Parameters

    • HeadersType = Record<string, string>
    Index

    Constructors

    Properties

    TypeConstrainer: typeof TypeConstrainer

    Methods

    • Parameters

      • value: string

      Returns this

    • Parameters

      • value: string

      Returns this

    • Parameters

      • key: string

      Returns this

    • Parameters

      • key: string

      Returns this

    • Parameters

      • key: string

      Returns this

    • Parameters

      • status: string

      Returns this