Documentation
    Preparing search index...

    Serve command is used to run the AdonisJS HTTP server during development. The command under the hood runs the "bin/server.ts" file and watches for file system changes

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    commandName: string = 'serve'

    The command name one can type to run the command

    description: string = 'Start the development HTTP server along with the file watcher to perform restarts on file change'

    The command description

    help: string[] = ...

    The help text for the command. Help text can be a multiline string explaining the usage of command

    options: CommandOptions = ...

    Configuration options accepted by the command

    devServer: DevServer
    hmr?: boolean
    watch?: boolean
    poll?: boolean
    clear?: boolean
    kernel: Kernel

    Accessors

    • get staysAlive(): undefined | boolean

      Returns undefined | boolean

    • get startApp(): undefined | boolean

      Returns undefined | boolean

    Methods

    • Runs the HTTP server

      Returns Promise<void>

    • The prepare template method is used to prepare the state for the command. This is the first method executed on a given command instance.

      Parameters

      • ..._: any[]

      Returns any

    • The interact template method is used to display the prompts to the user. The method is called after the prepare method.

      Parameters

      • ..._: any[]

      Returns any

    • The completed method is the method invoked after the command finishes or results in an error.

      You can access the command error using the this.error property. Returning true from completed method supresses the error reporting to the kernel layer.

      Parameters

      • ..._: any[]

      Returns any

    • Terminate the app. A command should prefer calling this method over the "app.terminate", because this method only triggers app termination when the current command is in the charge of the process.

      Returns Promise<void>