Class MoxyServer

Constructors

Properties

router: Router

The internal router

Instance of HTTP server

Accessors

Methods

  • Recursively search the folder at for files matching .routes.js(on) and import their config

    Parameters

    • Optionalpath: string

      The path

    Returns Promise<MoxyServer>

  • Gets the folder contents

    Parameters

    • dirPath: string

      The dir path

    Returns Promise<Dirent[]>

  • Loads a configuration from file

    Parameters

    • filePath: string

      The file path

    • basePath: string

      The base path

    Returns void

  • Same as calling @MoxyServer.on over Object.entries with a prefx

    Parameters

    • prefix: string

      The path prefix to prepend to all routes

    • routes: Routes

      Path suffix keyed RouteConfig

    • Optionaloptions: AddRouteOptions

      Extra router options

    Returns this