diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index 9e8a3cc..9b0beb5 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACo2TsW6DMBBA/+Vm1DQooS1bhVR1iVRlrTpYcBCr7pn4DpWqyr93MMhAKGT183uyzvb7Lwi2Aik8t5Yy6xAiqJWcIIXcKGbkTU/uTvJlIIJPTQWk2/jxEo3so20E3bzv2VrhzTSVplDQJOhKlXcRj8eReJ8MIq+oCnQ8W+jYkn7Ec4Mss3rHlnWuLTH+43u4FOgnnVkqdRUy8lMP7sHTSef+6WG7j69bvNji21v9+Q/IrCqcC062rFUzS+KsMcM342OBrDUOuigMfit3daBA1hqErbzQ1Pert0wmmGVDuWhLfhxjN9kNX8rkqwRx7qMku8vHH35RzDCpAwAA" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACo2TQWuDMBSA/0vOsq3Sus3bEEYvhdLr2CHo04ZmLy7vSR2j/32HKInWqdd8+T7CS/LxKxhaFql4aw1mxoKIRC35LFKRa0kE9NiThzN/aRGJi8JCpJv45RYN7JNpGOy079hS4aibSqEvKGSwpcy7iMPDSLxLgsgeZAGWJgsdm9NP8N0A8aTesXmdaoME//gOzgX6SWcGS1X5DP/UwT04Ouo8vT5vdvF9i2ZbtL61Z65nYgFeU+uncQAiWcFUcbRlqZoZZGu0Dl+gi3my1DiootBwlfbuQJ4sNRBafsex71bXTMabZYM5K4NuHEM32YbvbvTxvDj17ZLt7fMP3pJgTPcDAAA=" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index b22c7c5..3edab3e 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAACq2bbW/bNhDHvwvzVnXNJ9vxu65zuwFrOyTY3hhBoFpMIkyWPEluMwT57gP1YN2JJ4t2/MqBdPe/I/njiaKY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dszod0QnzWCXE/oOojeCAXkIqXADovAlIBbeLT2pf7dfsGbCWBbl90gto3NTxFBGBT+k0RtAcOegkoKb9kIvN9j+nWgG6/nmkPaAARDkT80KlPQ+TNaQggBYZeKG+pgq5GYLSUX17VcSAAEKhnfOGnUB3w2oItPSAHZi33ax3RLNAqv5TqjVVAMWiV9uuX9iAZaAsgh/vVRXvYzq2J3RGxF8Y9s8nCyK2JHGDI/WaWFcrr439ABzDI/eZVkj0+4kohQBUUfsNUi9z/MPn3rMATDAyY8Kv22/C5V+AVKIbKD776s2ialWH7lRtMLlik/cr84SsrUAHdpPye9/TUUqAYaj8c6w1rIAGI1n652K9DD/jBDLpF+RXUNCsf6tMWoF8Ay9JvsA7n2QA3YGoJP5IblaL+pNee8gbtA5LKb9jbL/ugdaCnpR/P7ZF5kAlIxFOiOsAIugfMCOFXMOqznKBWgGLMPVvSfsndHL7kgkaBcVd+GFdnP0FGYCIIP4rz9l8uQNcAEU+N9r8QOhE4n04SuW/Wpxhm0NXSs2Hu4hQMl5dEffrI1KePAMGgg6Rf49y5BGqf30w6fIsFwAAR7dGku4Dt4p1J4tSw5fru9fV/UBN6bhc0AAA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAACq2b23LbNhCG3wW+ZRXhpNNdmqpJZ5omY7e90Xg8jATbnNKkSlKJOx6/ewc87hJLEZJ1JY+4++8C+LCAQPiFZemPnK02L+yfKNmx1UwFLAmfDFux989pwgJ2yGK2YveHZFtEaZK/s19PHounmAVsG4d5bnK2Yuw1ICSu00NhMkKkenBURuhZp2P+PZi8aIWipDDZfbg1+bv60VEpPhVdTt/S3X9jQle1UadW5LufovynKHk0WVSYHQvYPsxMUoDsBgLuwyx8ykdDtmbnBsUdlu/TJDd01OqZf5flRVgcBloAtK5aO98m1EkCdrSWXSvu7or/9uNtqONOWnPQIiLcpE6T7rlPJtyZjGxs/eh4v4kFmkAf0qxrQO3xrnlwVElz0Spt0yQvssO2SLPjYlfYku6INi/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xtBKikwm+oK5G77yb7luZ4kgKUhd8S+xQ+9xYJBbpH+Q1Y9bI6SYuwuXsAOATzQfpVn/bdN1ABLVN+Y0ZPTw1ap/3SqQ77QQeBXLQfiPbN2j1e3MG0UH5DlaTFfXUHBvQLmBTSb7Da+42AG6Ai/EiuVfLqRWtz6x+0D0wO5dfPzX0L0DowOZTfvrP5FwqQCdDwlCgvtILuAaVU+MFX3e0FtQIUdO433O379W37fh00CoyY8tuAlXeBQUaguAu/vs2af8EBXQNEPDWa/0oBcxLMp5NE7uo9LoYZdLX0bJi7wQXD5SVR3Qkz1Z0wQDDc5vqNkzuXwCzwk2jfYwNgQK9ojyl+G7B9tDdxlBi22ty+vv4Pu9qHyCc2AAA="; \ No newline at end of file diff --git a/docs/classes/AxonCore.html b/docs/classes/AxonCore.html index d6ef736..1351183 100644 --- a/docs/classes/AxonCore.html +++ b/docs/classes/AxonCore.html @@ -1,18 +1,18 @@ -AxonCore | @mr-mkz/axon

Class AxonCore

Constructors

constructor +AxonCore | @mr-mkz/axon

Class AxonCore

Constructors

Methods

  • Start listening to http incoming requests

    +

Constructors

Methods

  • Start listening to http incoming requests

    Parameters

    • host: string = "127.0.0.1"

      server host address

      -
    • port: number = 8000

      server port

      -
    • Optionalcallback: (() => void)

      callback a function to run after starting to listen

      -
        • (): void
        • Returns void

    Returns Promise<void>

  • A method to config core as you want

    +
  • port: number | {
        http: number;
        https: number;
    } = 8000

    server port

    +
  • Optionalcallback: ((mode?: string) => void)

    callback a function to run after starting to listen

    +
      • (mode?): void
      • Parameters

        • Optionalmode: string

        Returns void

Returns Promise<void>

Returns Promise<void>

Returns Promise<void>

+
  • Optionalprefix: string
  • Returns Promise<void>

    diff --git a/docs/classes/AxonRouter.html b/docs/classes/AxonRouter.html index 2e0f708..506d193 100644 --- a/docs/classes/AxonRouter.html +++ b/docs/classes/AxonRouter.html @@ -1,4 +1,4 @@ -AxonRouter | @mr-mkz/axon

    Class AxonRouter

    Constructors

    constructor +AxonRouter | @mr-mkz/axon

    Class AxonRouter

    Constructors

    Methods

    delete exportRoutes get @@ -6,11 +6,11 @@ patch post put -

    Constructors

    Methods

    • Endpoint with method DELETE

      +

    Constructors

    Methods

    • Endpoint with method DELETE

      The DELETE HTTP request method sends data to the server for deleting a data.

      Parameters

      • path: string

        route path

      • controller: Controller

        route request controller

        -

      Returns AxonRouteHandler

    • Endpoint with method GET

      +

    Returns AxonRouteHandler

    Returns AxonRouteHandler

    Returns AxonRouteHandler

    Returns AxonRouteHandler

    Returns AxonRouteHandler

    +

    Returns AxonRouteHandler

    diff --git a/docs/functions/Axon.html b/docs/functions/Axon.html index 11146aa..359c05c 100644 --- a/docs/functions/Axon.html +++ b/docs/functions/Axon.html @@ -1,3 +1,3 @@ Axon | @mr-mkz/axon

    Function Axon

    Instance of AxonCore for easier usage

    +
    diff --git a/docs/functions/Router.html b/docs/functions/Router.html index b4ef45f..8eca1a2 100644 --- a/docs/functions/Router.html +++ b/docs/functions/Router.html @@ -1,3 +1,3 @@ Router | @mr-mkz/axon

    Function Router

    Instance of AxonRouter for easier usage

    +
    diff --git a/docs/index.html b/docs/index.html index 7652a7b..4d163be 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,10 +3,7 @@

    Currently Axon is 2X faster than Express. :D please checkout Axon Benchmarks

    Latest change:

    Install Axon.js with npm

    @@ -43,6 +40,7 @@
  • Plugin manager (You can create your own plugins and use them in other projects)
  • Controllers and Middlewares
  • Default cors configuration method
  • +
  • Support https server
  • More features soon...

    listen method runs your webserver.

    +

    If you want to run your server on https, you have to set key and cert file in HTTPS config of core to run https server automatically by core

    +
    core.loadConfig({
    HTTPS: {
    key: fs.readFileSync(path.join("server.key")),
    cert: fs.readFileSync(path.join("server.crt"))
    }
    }) +
    +

    core.listen() has some default values

    1. host: default value of host in 127.0.0.1
    2. diff --git a/docs/interfaces/AxonPlugin.html b/docs/interfaces/AxonPlugin.html index 220079a..7a5ddb7 100644 --- a/docs/interfaces/AxonPlugin.html +++ b/docs/interfaces/AxonPlugin.html @@ -1,4 +1,4 @@ -AxonPlugin | @mr-mkz/axon

      Interface AxonPlugin

      interface AxonPlugin {
          name: string;
          version: string;
          init(core: AxonCore): void;
          [methodName: string]: any;
      }

      Indexable

      • [methodName: string]: any

      Properties

      name +AxonPlugin | @mr-mkz/axon

      Interface AxonPlugin

      interface AxonPlugin {
          name: string;
          version: string;
          init(core: AxonCore): void;
          [methodName: string]: any;
      }

      Indexable

      • [methodName: string]: any

      Properties

      Methods

      Properties

      name: string
      version: string

      Methods

      +

      Properties

      name: string
      version: string

      Methods

      diff --git a/docs/interfaces/Headers.html b/docs/interfaces/Headers.html index f05ff6f..38bbd98 100644 --- a/docs/interfaces/Headers.html +++ b/docs/interfaces/Headers.html @@ -1,4 +1,4 @@ -Headers | @mr-mkz/axon

      Interface Headers

      interface Headers {
          accept?: string | string[];
          accept-charset?: string | string[];
          accept-encoding?: string | string[];
          accept-language?: string | string[];
          accept-ranges?: string;
          access-control-allow-credentials?: string;
          access-control-allow-headers?: string;
          access-control-allow-methods?: string;
          access-control-allow-origin?: string;
          access-control-expose-headers?: string;
          access-control-max-age?: string;
          access-control-request-headers?: string;
          access-control-request-method?: string;
          age?: string;
          allow?: string;
          authorization?: string;
          cache-control?: string;
          cdn-cache-control?: string;
          connection?: string | string[];
          content-disposition?: string;
          content-encoding?: string;
          content-language?: string;
          content-length?: string | number;
          content-location?: string;
          content-range?: string;
          content-security-policy?: string;
          content-security-policy-report-only?: string;
          cookie?: string | string[];
          date?: string;
          dav?: string | string[];
          dnt?: string;
          etag?: string;
          expect?: string;
          expires?: string;
          forwarded?: string;
          from?: string;
          host?: string;
          if-match?: string;
          if-modified-since?: string;
          if-none-match?: string;
          if-range?: string;
          if-unmodified-since?: string;
          last-modified?: string;
          link?: string | string[];
          location?: string;
          max-forwards?: string;
          origin?: string;
          prgama?: string | string[];
          proxy-authenticate?: string | string[];
          proxy-authorization?: string;
          public-key-pins?: string;
          public-key-pins-report-only?: string;
          range?: string;
          referer?: string;
          referrer-policy?: string;
          refresh?: string;
          retry-after?: string;
          sec-websocket-accept?: string;
          sec-websocket-extensions?: string | string[];
          sec-websocket-key?: string;
          sec-websocket-protocol?: string | string[];
          sec-websocket-version?: string;
          server?: string;
          set-cookie?: string | string[];
          strict-transport-security?: string;
          te?: string;
          trailer?: string;
          transfer-encoding?: string;
          upgrade?: string;
          upgrade-insecure-requests?: string;
          user-agent?: string;
          vary?: string;
          via?: string | string[];
          warning?: string;
          www-authenticate?: string | string[];
          x-content-type-options?: string;
          x-dns-prefetch-control?: string;
          x-frame-options?: string;
          x-xss-protection?: string;
      }

      Hierarchy

      • OutgoingHttpHeaders
        • Headers

      Properties

      accept? +Headers | @mr-mkz/axon

      Interface Headers

      interface Headers {
          accept?: string | string[];
          accept-charset?: string | string[];
          accept-encoding?: string | string[];
          accept-language?: string | string[];
          accept-ranges?: string;
          access-control-allow-credentials?: string;
          access-control-allow-headers?: string;
          access-control-allow-methods?: string;
          access-control-allow-origin?: string;
          access-control-expose-headers?: string;
          access-control-max-age?: string;
          access-control-request-headers?: string;
          access-control-request-method?: string;
          age?: string;
          allow?: string;
          authorization?: string;
          cache-control?: string;
          cdn-cache-control?: string;
          connection?: string | string[];
          content-disposition?: string;
          content-encoding?: string;
          content-language?: string;
          content-length?: string | number;
          content-location?: string;
          content-range?: string;
          content-security-policy?: string;
          content-security-policy-report-only?: string;
          cookie?: string | string[];
          date?: string;
          dav?: string | string[];
          dnt?: string;
          etag?: string;
          expect?: string;
          expires?: string;
          forwarded?: string;
          from?: string;
          host?: string;
          if-match?: string;
          if-modified-since?: string;
          if-none-match?: string;
          if-range?: string;
          if-unmodified-since?: string;
          last-modified?: string;
          link?: string | string[];
          location?: string;
          max-forwards?: string;
          origin?: string;
          prgama?: string | string[];
          proxy-authenticate?: string | string[];
          proxy-authorization?: string;
          public-key-pins?: string;
          public-key-pins-report-only?: string;
          range?: string;
          referer?: string;
          referrer-policy?: string;
          refresh?: string;
          retry-after?: string;
          sec-websocket-accept?: string;
          sec-websocket-extensions?: string | string[];
          sec-websocket-key?: string;
          sec-websocket-protocol?: string | string[];
          sec-websocket-version?: string;
          server?: string;
          set-cookie?: string | string[];
          strict-transport-security?: string;
          te?: string;
          trailer?: string;
          transfer-encoding?: string;
          upgrade?: string;
          upgrade-insecure-requests?: string;
          user-agent?: string;
          vary?: string;
          via?: string | string[];
          warning?: string;
          www-authenticate?: string | string[];
          x-content-type-options?: string;
          x-dns-prefetch-control?: string;
          x-frame-options?: string;
          x-xss-protection?: string;
      }

      Hierarchy

      • OutgoingHttpHeaders
        • Headers

      Properties

      accept? accept-charset? accept-encoding? accept-language? diff --git a/docs/interfaces/Request.html b/docs/interfaces/Request.html index 22bc8e2..5523eb0 100644 --- a/docs/interfaces/Request.html +++ b/docs/interfaces/Request.html @@ -1,4 +1,4 @@ -Request | @mr-mkz/axon

      Interface Request

      interface Request {
          aborted: boolean;
          body?: any;
          closed: boolean;
          complete: boolean;
          connection: Socket;
          destroyed: boolean;
          errored: null | Error;
          headers: IncomingHttpHeaders;
          headersDistinct: Dict<string[]>;
          httpVersion: string;
          httpVersionMajor: number;
          httpVersionMinor: number;
          method?: string;
          params: any;
          rawHeaders: string[];
          rawTrailers: string[];
          readable: boolean;
          readableAborted: boolean;
          readableDidRead: boolean;
          readableEncoding: null | BufferEncoding;
          readableEnded: boolean;
          readableFlowing: null | boolean;
          readableHighWaterMark: number;
          readableLength: number;
          readableObjectMode: boolean;
          socket: Socket;
          statusCode?: number;
          statusMessage?: string;
          trailers: Dict<string>;
          trailersDistinct: Dict<string[]>;
          url?: string;
          _construct?(callback: ((error?: null | Error) => void)): void;
          _destroy(error: null | Error, callback: ((error?: null | Error) => void)): void;
          _read(size: number): void;
          [asyncDispose](): Promise<void>;
          [asyncIterator](): AsyncIterableIterator<any, any, any>;
          [captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: AnyRest): void;
          addListener(event: "close", listener: (() => void)): this;
          addListener(event: "data", listener: ((chunk: any) => void)): this;
          addListener(event: "end", listener: (() => void)): this;
          addListener(event: "error", listener: ((err: Error) => void)): this;
          addListener(event: "pause", listener: (() => void)): this;
          addListener(event: "readable", listener: (() => void)): this;
          addListener(event: "resume", listener: (() => void)): this;
          addListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          asIndexedPairs(options?: Pick<ArrayOptions, "signal">): Readable;
          compose<T>(stream:
              | ComposeFnParam
              | T
              | Iterable<T, any, any>
              | AsyncIterable<T, any, any>, options?: {
              signal: AbortSignal;
          }): T;
          destroy(error?: Error): this;
          drop(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
          emit(event: "close"): boolean;
          emit(event: "data", chunk: any): boolean;
          emit(event: "end"): boolean;
          emit(event: "error", err: Error): boolean;
          emit(event: "pause"): boolean;
          emit(event: "readable"): boolean;
          emit(event: "resume"): boolean;
          emit(event: string | symbol, ...args: any[]): boolean;
          eventNames(): (string | symbol)[];
          every(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Promise<boolean>;
          filter(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Readable;
          find<T>(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => data is T), options?: ArrayOptions): Promise<undefined | T>;
          find(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Promise<any>;
          flatMap(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => any), options?: ArrayOptions): Readable;
          forEach(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => void | Promise<void>), options?: ArrayOptions): Promise<void>;
          getMaxListeners(): number;
          isPaused(): boolean;
          iterator(options?: {
              destroyOnReturn?: boolean;
          }): AsyncIterableIterator<any, any, any>;
          listenerCount<K>(eventName: string | symbol, listener?: Function): number;
          listeners<K>(eventName: string | symbol): Function[];
          map(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => any), options?: ArrayOptions): Readable;
          off<K>(eventName: string | symbol, listener: ((...args: any[]) => void)): this;
          on(event: "close", listener: (() => void)): this;
          on(event: "data", listener: ((chunk: any) => void)): this;
          on(event: "end", listener: (() => void)): this;
          on(event: "error", listener: ((err: Error) => void)): this;
          on(event: "pause", listener: (() => void)): this;
          on(event: "readable", listener: (() => void)): this;
          on(event: "resume", listener: (() => void)): this;
          on(event: string | symbol, listener: ((...args: any[]) => void)): this;
          once(event: "close", listener: (() => void)): this;
          once(event: "data", listener: ((chunk: any) => void)): this;
          once(event: "end", listener: (() => void)): this;
          once(event: "error", listener: ((err: Error) => void)): this;
          once(event: "pause", listener: (() => void)): this;
          once(event: "readable", listener: (() => void)): this;
          once(event: "resume", listener: (() => void)): this;
          once(event: string | symbol, listener: ((...args: any[]) => void)): this;
          pause(): this;
          pipe<T>(destination: T, options?: {
              end?: boolean;
          }): T;
          prependListener(event: "close", listener: (() => void)): this;
          prependListener(event: "data", listener: ((chunk: any) => void)): this;
          prependListener(event: "end", listener: (() => void)): this;
          prependListener(event: "error", listener: ((err: Error) => void)): this;
          prependListener(event: "pause", listener: (() => void)): this;
          prependListener(event: "readable", listener: (() => void)): this;
          prependListener(event: "resume", listener: (() => void)): this;
          prependListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          prependOnceListener(event: "close", listener: (() => void)): this;
          prependOnceListener(event: "data", listener: ((chunk: any) => void)): this;
          prependOnceListener(event: "end", listener: (() => void)): this;
          prependOnceListener(event: "error", listener: ((err: Error) => void)): this;
          prependOnceListener(event: "pause", listener: (() => void)): this;
          prependOnceListener(event: "readable", listener: (() => void)): this;
          prependOnceListener(event: "resume", listener: (() => void)): this;
          prependOnceListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          push(chunk: any, encoding?: BufferEncoding): boolean;
          rawListeners<K>(eventName: string | symbol): Function[];
          read(size?: number): any;
          reduce<T>(fn: ((previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T), initial?: undefined, options?: Pick<ArrayOptions, "signal">): Promise<T>;
          reduce<T>(fn: ((previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T), initial: T, options?: Pick<ArrayOptions, "signal">): Promise<T>;
          removeAllListeners(eventName?: string | symbol): this;
          removeListener(event: "close", listener: (() => void)): this;
          removeListener(event: "data", listener: ((chunk: any) => void)): this;
          removeListener(event: "end", listener: (() => void)): this;
          removeListener(event: "error", listener: ((err: Error) => void)): this;
          removeListener(event: "pause", listener: (() => void)): this;
          removeListener(event: "readable", listener: (() => void)): this;
          removeListener(event: "resume", listener: (() => void)): this;
          removeListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          resume(): this;
          setEncoding(encoding: BufferEncoding): this;
          setMaxListeners(n: number): this;
          setTimeout(msecs: number, callback?: (() => void)): this;
          some(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Promise<boolean>;
          take(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
          toArray(options?: Pick<ArrayOptions, "signal">): Promise<any[]>;
          unpipe(destination?: WritableStream): this;
          unshift(chunk: any, encoding?: BufferEncoding): void;
          wrap(stream: ReadableStream): this;
      }

      Hierarchy

      • IncomingMessage
        • Request

      Properties

      aborted +Request | @mr-mkz/axon

      Interface Request

      interface Request {
          aborted: boolean;
          body?: any;
          closed: boolean;
          complete: boolean;
          connection: Socket;
          destroyed: boolean;
          errored: null | Error;
          headers: IncomingHttpHeaders;
          headersDistinct: Dict<string[]>;
          httpVersion: string;
          httpVersionMajor: number;
          httpVersionMinor: number;
          method?: string;
          params: any;
          rawHeaders: string[];
          rawTrailers: string[];
          readable: boolean;
          readableAborted: boolean;
          readableDidRead: boolean;
          readableEncoding: null | BufferEncoding;
          readableEnded: boolean;
          readableFlowing: null | boolean;
          readableHighWaterMark: number;
          readableLength: number;
          readableObjectMode: boolean;
          socket: Socket;
          statusCode?: number;
          statusMessage?: string;
          trailers: Dict<string>;
          trailersDistinct: Dict<string[]>;
          url?: string;
          _construct?(callback: ((error?: null | Error) => void)): void;
          _destroy(error: null | Error, callback: ((error?: null | Error) => void)): void;
          _read(size: number): void;
          [asyncDispose](): Promise<void>;
          [asyncIterator](): AsyncIterableIterator<any, any, any>;
          [captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: AnyRest): void;
          addListener(event: "close", listener: (() => void)): this;
          addListener(event: "data", listener: ((chunk: any) => void)): this;
          addListener(event: "end", listener: (() => void)): this;
          addListener(event: "error", listener: ((err: Error) => void)): this;
          addListener(event: "pause", listener: (() => void)): this;
          addListener(event: "readable", listener: (() => void)): this;
          addListener(event: "resume", listener: (() => void)): this;
          addListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          asIndexedPairs(options?: Pick<ArrayOptions, "signal">): Readable;
          compose<T>(stream:
              | ComposeFnParam
              | T
              | Iterable<T, any, any>
              | AsyncIterable<T, any, any>, options?: {
              signal: AbortSignal;
          }): T;
          destroy(error?: Error): this;
          drop(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
          emit(event: "close"): boolean;
          emit(event: "data", chunk: any): boolean;
          emit(event: "end"): boolean;
          emit(event: "error", err: Error): boolean;
          emit(event: "pause"): boolean;
          emit(event: "readable"): boolean;
          emit(event: "resume"): boolean;
          emit(event: string | symbol, ...args: any[]): boolean;
          eventNames(): (string | symbol)[];
          every(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Promise<boolean>;
          filter(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Readable;
          find<T>(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => data is T), options?: ArrayOptions): Promise<undefined | T>;
          find(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Promise<any>;
          flatMap(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => any), options?: ArrayOptions): Readable;
          forEach(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => void | Promise<void>), options?: ArrayOptions): Promise<void>;
          getMaxListeners(): number;
          isPaused(): boolean;
          iterator(options?: {
              destroyOnReturn?: boolean;
          }): AsyncIterableIterator<any, any, any>;
          listenerCount<K>(eventName: string | symbol, listener?: Function): number;
          listeners<K>(eventName: string | symbol): Function[];
          map(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => any), options?: ArrayOptions): Readable;
          off<K>(eventName: string | symbol, listener: ((...args: any[]) => void)): this;
          on(event: "close", listener: (() => void)): this;
          on(event: "data", listener: ((chunk: any) => void)): this;
          on(event: "end", listener: (() => void)): this;
          on(event: "error", listener: ((err: Error) => void)): this;
          on(event: "pause", listener: (() => void)): this;
          on(event: "readable", listener: (() => void)): this;
          on(event: "resume", listener: (() => void)): this;
          on(event: string | symbol, listener: ((...args: any[]) => void)): this;
          once(event: "close", listener: (() => void)): this;
          once(event: "data", listener: ((chunk: any) => void)): this;
          once(event: "end", listener: (() => void)): this;
          once(event: "error", listener: ((err: Error) => void)): this;
          once(event: "pause", listener: (() => void)): this;
          once(event: "readable", listener: (() => void)): this;
          once(event: "resume", listener: (() => void)): this;
          once(event: string | symbol, listener: ((...args: any[]) => void)): this;
          pause(): this;
          pipe<T>(destination: T, options?: {
              end?: boolean;
          }): T;
          prependListener(event: "close", listener: (() => void)): this;
          prependListener(event: "data", listener: ((chunk: any) => void)): this;
          prependListener(event: "end", listener: (() => void)): this;
          prependListener(event: "error", listener: ((err: Error) => void)): this;
          prependListener(event: "pause", listener: (() => void)): this;
          prependListener(event: "readable", listener: (() => void)): this;
          prependListener(event: "resume", listener: (() => void)): this;
          prependListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          prependOnceListener(event: "close", listener: (() => void)): this;
          prependOnceListener(event: "data", listener: ((chunk: any) => void)): this;
          prependOnceListener(event: "end", listener: (() => void)): this;
          prependOnceListener(event: "error", listener: ((err: Error) => void)): this;
          prependOnceListener(event: "pause", listener: (() => void)): this;
          prependOnceListener(event: "readable", listener: (() => void)): this;
          prependOnceListener(event: "resume", listener: (() => void)): this;
          prependOnceListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          push(chunk: any, encoding?: BufferEncoding): boolean;
          rawListeners<K>(eventName: string | symbol): Function[];
          read(size?: number): any;
          reduce<T>(fn: ((previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T), initial?: undefined, options?: Pick<ArrayOptions, "signal">): Promise<T>;
          reduce<T>(fn: ((previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T), initial: T, options?: Pick<ArrayOptions, "signal">): Promise<T>;
          removeAllListeners(eventName?: string | symbol): this;
          removeListener(event: "close", listener: (() => void)): this;
          removeListener(event: "data", listener: ((chunk: any) => void)): this;
          removeListener(event: "end", listener: (() => void)): this;
          removeListener(event: "error", listener: ((err: Error) => void)): this;
          removeListener(event: "pause", listener: (() => void)): this;
          removeListener(event: "readable", listener: (() => void)): this;
          removeListener(event: "resume", listener: (() => void)): this;
          removeListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          resume(): this;
          setEncoding(encoding: BufferEncoding): this;
          setMaxListeners(n: number): this;
          setTimeout(msecs: number, callback?: (() => void)): this;
          some(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Promise<boolean>;
          take(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
          toArray(options?: Pick<ArrayOptions, "signal">): Promise<any[]>;
          unpipe(destination?: WritableStream): this;
          unshift(chunk: any, encoding?: BufferEncoding): void;
          wrap(stream: ReadableStream): this;
      }

      Hierarchy

      • IncomingMessage
        • Request

      Properties

      aborted body? closed complete @@ -81,7 +81,7 @@

      v10.1.0

      Since v17.0.0,v16.12.0 - Check message.destroyed from stream.Readable.

      body?: any

      the body of request which sent from client

      -
      closed: boolean

      Is true after 'close' has been emitted.

      +
      closed: boolean

      Is true after 'close' has been emitted.

      v18.0.0

      complete: boolean

      The message.complete property will be true if a complete HTTP message has been received and successfully parsed.

      @@ -137,7 +137,7 @@
      rawHeaders: string[]

      The raw request/response headers list exactly as they were received.

      +
      rawHeaders: string[]

      The raw request/response headers list exactly as they were received.

      The keys and values are in the same list. It is not a list of tuples. So, the even-numbered offsets are key values, and the odd-numbered offsets are the associated values.

      diff --git a/docs/interfaces/Response.html b/docs/interfaces/Response.html index 0bf80f9..0980baa 100644 --- a/docs/interfaces/Response.html +++ b/docs/interfaces/Response.html @@ -1,4 +1,4 @@ -Response | @mr-mkz/axon

      Interface Response

      interface Response {
          chunkedEncoding: boolean;
          closed: boolean;
          connection: null | Socket;
          destroyed: boolean;
          errored: null | Error;
          finished: boolean;
          headersSent: boolean;
          req: IncomingMessage;
          sendDate: boolean;
          shouldKeepAlive: boolean;
          socket: null | Socket;
          status: ((code: number) => AxonResponse);
          statusCode: number;
          statusMessage: string;
          strictContentLength: boolean;
          useChunkedEncodingByDefault: boolean;
          writable: boolean;
          writableCorked: number;
          writableEnded: boolean;
          writableFinished: boolean;
          writableHighWaterMark: number;
          writableLength: number;
          writableNeedDrain: boolean;
          writableObjectMode: boolean;
          _construct?(callback: ((error?: null | Error) => void)): void;
          _destroy(error: null | Error, callback: ((error?: null | Error) => void)): void;
          _final(callback: ((error?: null | Error) => void)): void;
          _write(chunk: any, encoding: BufferEncoding, callback: ((error?: null | Error) => void)): void;
          _writev?(chunks: {
              chunk: any;
              encoding: BufferEncoding;
          }[], callback: ((error?: null | Error) => void)): void;
          [captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: AnyRest): void;
          addListener(event: "close", listener: (() => void)): this;
          addListener(event: "drain", listener: (() => void)): this;
          addListener(event: "error", listener: ((err: Error) => void)): this;
          addListener(event: "finish", listener: (() => void)): this;
          addListener(event: "pipe", listener: ((src: Readable) => void)): this;
          addListener(event: "unpipe", listener: ((src: Readable) => void)): this;
          addListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          addTrailers(headers: OutgoingHttpHeaders | readonly [string, string][]): void;
          appendHeader(name: string, value: string | readonly string[]): this;
          assignSocket(socket: Socket): void;
          compose<T>(stream:
              | ComposeFnParam
              | T
              | Iterable<T, any, any>
              | AsyncIterable<T, any, any>, options?: {
              signal: AbortSignal;
          }): T;
          cork(): void;
          destroy(error?: Error): this;
          detachSocket(socket: Socket): void;
          emit(event: "close"): boolean;
          emit(event: "drain"): boolean;
          emit(event: "error", err: Error): boolean;
          emit(event: "finish"): boolean;
          emit(event: "pipe", src: Readable): boolean;
          emit(event: "unpipe", src: Readable): boolean;
          emit(event: string | symbol, ...args: any[]): boolean;
          end(cb?: (() => void)): this;
          end(chunk: any, cb?: (() => void)): this;
          end(chunk: any, encoding: BufferEncoding, cb?: (() => void)): this;
          eventNames(): (string | symbol)[];
          flushHeaders(): void;
          getHeader(name: string):
              | undefined
              | string
              | number
              | string[];
          getHeaderNames(): string[];
          getHeaders(): OutgoingHttpHeaders;
          getMaxListeners(): number;
          hasHeader(name: string): boolean;
          listenerCount<K>(eventName: string | symbol, listener?: Function): number;
          listeners<K>(eventName: string | symbol): Function[];
          off<K>(eventName: string | symbol, listener: ((...args: any[]) => void)): this;
          on(event: "close", listener: (() => void)): this;
          on(event: "drain", listener: (() => void)): this;
          on(event: "error", listener: ((err: Error) => void)): this;
          on(event: "finish", listener: (() => void)): this;
          on(event: "pipe", listener: ((src: Readable) => void)): this;
          on(event: "unpipe", listener: ((src: Readable) => void)): this;
          on(event: string | symbol, listener: ((...args: any[]) => void)): this;
          once(event: "close", listener: (() => void)): this;
          once(event: "drain", listener: (() => void)): this;
          once(event: "error", listener: ((err: Error) => void)): this;
          once(event: "finish", listener: (() => void)): this;
          once(event: "pipe", listener: ((src: Readable) => void)): this;
          once(event: "unpipe", listener: ((src: Readable) => void)): this;
          once(event: string | symbol, listener: ((...args: any[]) => void)): this;
          pipe<T>(destination: T, options?: {
              end?: boolean;
          }): T;
          prependListener(event: "close", listener: (() => void)): this;
          prependListener(event: "drain", listener: (() => void)): this;
          prependListener(event: "error", listener: ((err: Error) => void)): this;
          prependListener(event: "finish", listener: (() => void)): this;
          prependListener(event: "pipe", listener: ((src: Readable) => void)): this;
          prependListener(event: "unpipe", listener: ((src: Readable) => void)): this;
          prependListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          prependOnceListener(event: "close", listener: (() => void)): this;
          prependOnceListener(event: "drain", listener: (() => void)): this;
          prependOnceListener(event: "error", listener: ((err: Error) => void)): this;
          prependOnceListener(event: "finish", listener: (() => void)): this;
          prependOnceListener(event: "pipe", listener: ((src: Readable) => void)): this;
          prependOnceListener(event: "unpipe", listener: ((src: Readable) => void)): this;
          prependOnceListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          rawListeners<K>(eventName: string | symbol): Function[];
          removeAllListeners(eventName?: string | symbol): this;
          removeHeader(name: string): void;
          removeListener(event: "close", listener: (() => void)): this;
          removeListener(event: "drain", listener: (() => void)): this;
          removeListener(event: "error", listener: ((err: Error) => void)): this;
          removeListener(event: "finish", listener: (() => void)): this;
          removeListener(event: "pipe", listener: ((src: Readable) => void)): this;
          removeListener(event: "unpipe", listener: ((src: Readable) => void)): this;
          removeListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          setDefaultEncoding(encoding: BufferEncoding): this;
          setHeader(name: string, value: string | number | readonly string[]): this;
          setMaxListeners(n: number): this;
          setTimeout(msecs: number, callback?: (() => void)): this;
          uncork(): void;
          write(chunk: any, callback?: ((error: undefined | null | Error) => void)): boolean;
          write(chunk: any, encoding: BufferEncoding, callback?: ((error: undefined | null | Error) => void)): boolean;
          writeContinue(callback?: (() => void)): void;
          writeEarlyHints(hints: Record<string, string | string[]>, callback?: (() => void)): void;
          writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
          writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
          writeProcessing(): void;
      }

      Hierarchy

      • ServerResponse
        • Response

      Properties

      chunkedEncoding +Response | @mr-mkz/axon

      Interface Response

      interface Response {
          chunkedEncoding: boolean;
          closed: boolean;
          connection: null | Socket;
          destroyed: boolean;
          errored: null | Error;
          finished: boolean;
          headersSent: boolean;
          req: IncomingMessage;
          sendDate: boolean;
          shouldKeepAlive: boolean;
          socket: null | Socket;
          status: ((code: number) => AxonResponse);
          statusCode: number;
          statusMessage: string;
          strictContentLength: boolean;
          useChunkedEncodingByDefault: boolean;
          writable: boolean;
          writableCorked: number;
          writableEnded: boolean;
          writableFinished: boolean;
          writableHighWaterMark: number;
          writableLength: number;
          writableNeedDrain: boolean;
          writableObjectMode: boolean;
          _construct?(callback: ((error?: null | Error) => void)): void;
          _destroy(error: null | Error, callback: ((error?: null | Error) => void)): void;
          _final(callback: ((error?: null | Error) => void)): void;
          _write(chunk: any, encoding: BufferEncoding, callback: ((error?: null | Error) => void)): void;
          _writev?(chunks: {
              chunk: any;
              encoding: BufferEncoding;
          }[], callback: ((error?: null | Error) => void)): void;
          [captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: AnyRest): void;
          addListener(event: "close", listener: (() => void)): this;
          addListener(event: "drain", listener: (() => void)): this;
          addListener(event: "error", listener: ((err: Error) => void)): this;
          addListener(event: "finish", listener: (() => void)): this;
          addListener(event: "pipe", listener: ((src: Readable) => void)): this;
          addListener(event: "unpipe", listener: ((src: Readable) => void)): this;
          addListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          addTrailers(headers: OutgoingHttpHeaders | readonly [string, string][]): void;
          appendHeader(name: string, value: string | readonly string[]): this;
          assignSocket(socket: Socket): void;
          compose<T>(stream:
              | ComposeFnParam
              | T
              | Iterable<T, any, any>
              | AsyncIterable<T, any, any>, options?: {
              signal: AbortSignal;
          }): T;
          cork(): void;
          destroy(error?: Error): this;
          detachSocket(socket: Socket): void;
          emit(event: "close"): boolean;
          emit(event: "drain"): boolean;
          emit(event: "error", err: Error): boolean;
          emit(event: "finish"): boolean;
          emit(event: "pipe", src: Readable): boolean;
          emit(event: "unpipe", src: Readable): boolean;
          emit(event: string | symbol, ...args: any[]): boolean;
          end(cb?: (() => void)): this;
          end(chunk: any, cb?: (() => void)): this;
          end(chunk: any, encoding: BufferEncoding, cb?: (() => void)): this;
          eventNames(): (string | symbol)[];
          flushHeaders(): void;
          getHeader(name: string):
              | undefined
              | string
              | number
              | string[];
          getHeaderNames(): string[];
          getHeaders(): OutgoingHttpHeaders;
          getMaxListeners(): number;
          hasHeader(name: string): boolean;
          listenerCount<K>(eventName: string | symbol, listener?: Function): number;
          listeners<K>(eventName: string | symbol): Function[];
          off<K>(eventName: string | symbol, listener: ((...args: any[]) => void)): this;
          on(event: "close", listener: (() => void)): this;
          on(event: "drain", listener: (() => void)): this;
          on(event: "error", listener: ((err: Error) => void)): this;
          on(event: "finish", listener: (() => void)): this;
          on(event: "pipe", listener: ((src: Readable) => void)): this;
          on(event: "unpipe", listener: ((src: Readable) => void)): this;
          on(event: string | symbol, listener: ((...args: any[]) => void)): this;
          once(event: "close", listener: (() => void)): this;
          once(event: "drain", listener: (() => void)): this;
          once(event: "error", listener: ((err: Error) => void)): this;
          once(event: "finish", listener: (() => void)): this;
          once(event: "pipe", listener: ((src: Readable) => void)): this;
          once(event: "unpipe", listener: ((src: Readable) => void)): this;
          once(event: string | symbol, listener: ((...args: any[]) => void)): this;
          pipe<T>(destination: T, options?: {
              end?: boolean;
          }): T;
          prependListener(event: "close", listener: (() => void)): this;
          prependListener(event: "drain", listener: (() => void)): this;
          prependListener(event: "error", listener: ((err: Error) => void)): this;
          prependListener(event: "finish", listener: (() => void)): this;
          prependListener(event: "pipe", listener: ((src: Readable) => void)): this;
          prependListener(event: "unpipe", listener: ((src: Readable) => void)): this;
          prependListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          prependOnceListener(event: "close", listener: (() => void)): this;
          prependOnceListener(event: "drain", listener: (() => void)): this;
          prependOnceListener(event: "error", listener: ((err: Error) => void)): this;
          prependOnceListener(event: "finish", listener: (() => void)): this;
          prependOnceListener(event: "pipe", listener: ((src: Readable) => void)): this;
          prependOnceListener(event: "unpipe", listener: ((src: Readable) => void)): this;
          prependOnceListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          rawListeners<K>(eventName: string | symbol): Function[];
          removeAllListeners(eventName?: string | symbol): this;
          removeHeader(name: string): void;
          removeListener(event: "close", listener: (() => void)): this;
          removeListener(event: "drain", listener: (() => void)): this;
          removeListener(event: "error", listener: ((err: Error) => void)): this;
          removeListener(event: "finish", listener: (() => void)): this;
          removeListener(event: "pipe", listener: ((src: Readable) => void)): this;
          removeListener(event: "unpipe", listener: ((src: Readable) => void)): this;
          removeListener(event: string | symbol, listener: ((...args: any[]) => void)): this;
          setDefaultEncoding(encoding: BufferEncoding): this;
          setHeader(name: string, value: string | number | readonly string[]): this;
          setMaxListeners(n: number): this;
          setTimeout(msecs: number, callback?: (() => void)): this;
          uncork(): void;
          write(chunk: any, callback?: ((error: undefined | null | Error) => void)): boolean;
          write(chunk: any, encoding: BufferEncoding, callback?: ((error: undefined | null | Error) => void)): boolean;
          writeContinue(callback?: (() => void)): void;
          writeEarlyHints(hints: Record<string, string | string[]>, callback?: (() => void)): void;
          writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
          writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
          writeProcessing(): void;
      }

      Hierarchy

      • ServerResponse
        • Response

      Properties

      chunkedEncoding closed connection destroyed @@ -85,7 +85,7 @@

      v0.3.0

      status: ((code: number) => AxonResponse)

      to add http response code for client.

      Type declaration

        • (code): AxonResponse
        • Parameters

          • code: number

            http response code

            -

          Returns AxonResponse

      statusCode: number

      When using implicit headers (not calling response.writeHead() explicitly), +

      Returns AxonResponse

      statusCode: number

      When using implicit headers (not calling response.writeHead() explicitly), this property controls the status code that will be sent to the client when the headers get flushed.

      response.statusCode = 404;
      diff --git a/docs/media/index.js b/docs/media/index.js
      index d64a865..54ee432 100644
      --- a/docs/media/index.js
      +++ b/docs/media/index.js
      @@ -3,6 +3,8 @@
        */
       
       import { Axon, Router } from "../src";
      +import path from "path";
      +import fs from "fs";
       
       const core = Axon();
       
      @@ -19,6 +21,10 @@ core.loadConfig({
           },
           CORS: {
               origin: 'https://github.com'
      +    },
      +    HTTPS: {
      +        key: fs.readFileSync(path.join("examples", "server.key")),
      +        cert: fs.readFileSync(path.join("examples", "server.crt"))
           }
       })
       
      diff --git a/docs/media/index.ts b/docs/media/index.ts
      index 33d4a7d..f829fe6 100644
      --- a/docs/media/index.ts
      +++ b/docs/media/index.ts
      @@ -6,6 +6,8 @@ import { Axon, Request, Response, nextFn } from "../src";
       import { v1Routes } from "./routes/v1";
       import { v2Routes } from "./routes/v2";
       import { LogPluginTest } from "./plugins/log";
      +import path from "path";
      +import fs from "fs";
       
       const core = Axon()
       
      @@ -18,6 +20,10 @@ core.loadConfig({
           },
           CORS: {
               origin: 'https://github.com'
      +    },
      +    HTTPS: {
      +        key: fs.readFileSync(path.join("examples", "server.key")),
      +        cert: fs.readFileSync(path.join("examples", "server.crt"))
           }
       })
       
      diff --git a/docs/modules.html b/docs/modules.html
      index 26cb44e..66455aa 100644
      --- a/docs/modules.html
      +++ b/docs/modules.html
      @@ -6,6 +6,7 @@
       Response
       

      Type Aliases

      AxonCoreConfig AxonCorsConfig +AxonHttpsConfig AxonResponseMessage Controller Middleware diff --git a/docs/types/AxonCoreConfig.html b/docs/types/AxonCoreConfig.html index 0060be1..345bc1e 100644 --- a/docs/types/AxonCoreConfig.html +++ b/docs/types/AxonCoreConfig.html @@ -1,6 +1,7 @@ -AxonCoreConfig | @mr-mkz/axon

      Type Alias AxonCoreConfig

      AxonCoreConfig: {
          CORS?: AxonCorsConfig;
          DEBUG?: boolean;
          LOGGER?: boolean;
          LOGGER_VERBOSE?: boolean;
          RESPONSE_MESSAGES?: AxonResponseMessage;
      }

      Type declaration

      • OptionalCORS?: AxonCorsConfig

        Cors configuration for AxonCore.

        +AxonCoreConfig | @mr-mkz/axon

        Type Alias AxonCoreConfig

        AxonCoreConfig: {
            CORS?: AxonCorsConfig;
            DEBUG?: boolean;
            HTTPS?: AxonHttpsConfig;
            LOGGER?: boolean;
            LOGGER_VERBOSE?: boolean;
            RESPONSE_MESSAGES?: AxonResponseMessage;
        }

        Type declaration

        • OptionalCORS?: AxonCorsConfig

          Cors configuration for AxonCore.

        • OptionalDEBUG?: boolean

          AxonCore debug mode.

          +
        • OptionalHTTPS?: AxonHttpsConfig

          Https configuration for AxonCore.

        • OptionalLOGGER?: boolean

          AxonCore logger.

        • OptionalLOGGER_VERBOSE?: boolean

          Verboose mode of logger.

        • OptionalRESPONSE_MESSAGES?: AxonResponseMessage

          Configuration for AxonCore custom response messages.

          -
        +
      diff --git a/docs/types/AxonCorsConfig.html b/docs/types/AxonCorsConfig.html index de9091e..b0967bf 100644 --- a/docs/types/AxonCorsConfig.html +++ b/docs/types/AxonCorsConfig.html @@ -56,4 +56,4 @@
    3. OptionalpreflightContinue?: boolean

      Pass the CORS preflight response to the next handler.

      -
    4. +
      diff --git a/docs/types/AxonHttpsConfig.html b/docs/types/AxonHttpsConfig.html new file mode 100644 index 0000000..1fdc4cb --- /dev/null +++ b/docs/types/AxonHttpsConfig.html @@ -0,0 +1 @@ +AxonHttpsConfig | @mr-mkz/axon

      Type Alias AxonHttpsConfig

      AxonHttpsConfig: ServerOptions
      diff --git a/docs/types/AxonResponseMessage.html b/docs/types/AxonResponseMessage.html index 6a4d880..82b0cd2 100644 --- a/docs/types/AxonResponseMessage.html +++ b/docs/types/AxonResponseMessage.html @@ -9,4 +9,4 @@
    5. OptionalnotFound?: string

      response error message for 404 not found response from core

      use {path} to show request method.

    6. OptionalserverError?: string

      response error message for 500 internal server error response from core

      -
    7. +
      diff --git a/docs/types/Controller.html b/docs/types/Controller.html index 8668002..d79cc93 100644 --- a/docs/types/Controller.html +++ b/docs/types/Controller.html @@ -1 +1 @@ -Controller | @mr-mkz/axon

      Type Alias Controller

      Controller: ((req: Request, res: Response) => Promise<any>)
      +Controller | @mr-mkz/axon

      Type Alias Controller

      Controller: ((req: Request, res: Response) => Promise<any>)
      diff --git a/docs/types/Middleware.html b/docs/types/Middleware.html index 8e9a4e4..18b6120 100644 --- a/docs/types/Middleware.html +++ b/docs/types/Middleware.html @@ -1 +1 @@ -Middleware | @mr-mkz/axon

      Type Alias Middleware

      Middleware: ((req: Request, res: Response, next: nextFn) => Promise<any>)
      +Middleware | @mr-mkz/axon

      Type Alias Middleware

      Middleware: ((req: Request, res: Response, next: nextFn) => Promise<any>)
      diff --git a/docs/types/nextFn.html b/docs/types/nextFn.html index a1fa785..4c072a8 100644 --- a/docs/types/nextFn.html +++ b/docs/types/nextFn.html @@ -1 +1 @@ -nextFn | @mr-mkz/axon

      Type Alias nextFn

      nextFn: (() => Promise<any>)
      +nextFn | @mr-mkz/axon

      Type Alias nextFn

      nextFn: (() => Promise<any>)
      diff --git a/package.json b/package.json index c8984ea..9cac6ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mr-mkz/axon", - "version": "0.4.3", + "version": "0.5.1", "description": "A backend library that aims to be simple and powerful.", "author": "Mr.MKZ", "license": "ISC",