You need to define a top-most MicroRouter which will be bootstrapped to serve as the main entry point of your app.

class MyRouter {

MicroBootstrap(MyRouter, bootstrapConfig)

When defining the port only, you may pass it as a number and use the other default configurations(micro-service optimized)

MicroBootstrap(MyRouter, 4200) // Listening on port 4200

Or leave it blank to listen on 3000 (default port).

MicroBootstrap(MyRouter) // Listening on port 3000

With configuration. See below for description.

const uws = required('uws')

MicroBootstrap(MyRouter, {
    port: 3000,
    server: uws.http

Bootstrap Configuration

bootstrapConfig.port - the port on which your app should be listening. Defaults to 3000

bootstrapConfig.cluster[DEPRECATED, you should handle this yourself] - whether to run the app multi-threaded. Defaults to false

bootstrapConfig.uws[DEPRECATE, see .server] - If true, microdose will use uWebSocket as it's networking interface. Defaults to false [EXPERIMENTAL]

bootstrapConfig.server - Plug your own server interface, defaults to http. You can play around with uws.http for example.

bootstrapConfig.turboMode - Disables URL pattern matching in place of performance boost. Defaults to false, see Turbo Mode

results matching ""

    No results matching ""