Documentation
    Preparing search index...

    Class Application<ContainerBindings>

    Application class manages the state of an AdonisJS application. It includes:

    • Setting up the base features like importing config and setting up logger.
    • Parsing the "adonisrc.js" file
    • Setting up the IoC container
    • Registering and booting providers
    • Invoking lifecycle methods on the providers and hooks

    The Application class extends Macroable to allow runtime extension of functionality. It manages the entire lifecycle from creation to termination, providing hooks at each stage for customization.

    Type Parameters

    • ContainerBindings extends Record<any, any>

      Type definition for IoC container bindings

    Hierarchy

    • default
      • Application
    Index

    Constructors

    Properties

    info: Map<string, any> = ...

    Stores metadata information about the application including app name, version, and AdonisJS version.

    stubs: { create: () => Promise<StubsManager> } = ...

    Reference to the stubs module for scaffolding resources or ejecting stubs. Provides functionality to create and manage code generation templates.

    experimentalFlags: FeatureFlags<ExperimentalFlagsList> = ...

    Feature flags manager for checking the status of experimental features. Reads configuration from adonisrc.js experimental section.

    usingVineJS: boolean = false

    Flag indicating if VineJS provider is configured and available. When true, the @vinejs/vine package can be safely imported.

    false
    
    usingEdgeJS: boolean = false

    Flag indicating if Edge template engine provider is configured. When true, the edge.js package can be safely imported.

    false
    
    container: Container<ContainerBindings>

    Reference to the AdonisJS IoC container. The container manages dependency injection and service binding throughout the application. Available after the "init" method has been called.

    Accessors

    • get appName(): any

      Returns the application name from the info map. Defaults to 'adonisjs_app' if not set.

      Returns any

    • get appRoot(): URL

      The URL for the root of the application directory.

      Returns URL

    • get isBooted(): boolean

      A boolean to know if the application has been booted. Returns true when the application state is beyond 'initiated'.

      Returns boolean

    • get isReady(): boolean

      A boolean to know if the application is ready and fully started. Returns true only when the application state is 'ready'.

      Returns boolean

    • get isTerminated(): boolean

      A boolean to know if the application has been terminated. Returns true only when the application state is 'terminated'.

      Returns boolean

    • get isTerminating(): boolean

      A boolean to know if the application is in the middle of the termination process but not yet fully terminated.

      Returns boolean

    • get config(): Config

      Reference to the config instance. The value is available after the "init" method has been called.

      Returns Config

    • get rcFile(): RcFile

      Reference to the parsed adonisrc.js file. The value is available after the "init" method has been called.

      Returns RcFile

    • get nodeEnvironment(): string

      Normalized current NODE_ENV value. Converts common variations to standard values (development, production, test).

      Returns string

    • get inProduction(): boolean

      Returns true when the NODE_ENV is set to 'production'. Useful for conditional logic based on production environment.

      Returns boolean

    • get inDev(): boolean

      Returns true when the NODE_ENV is set to 'development'. Useful for enabling development-specific features.

      Returns boolean

    • get inTest(): boolean

      Returns true when the NODE_ENV is set to 'test'. Useful for enabling test-specific behavior.

      Returns boolean

    • get managedByPm2(): boolean

      Returns true if the process is managed and running under PM2. Detected by checking for the pm2_id environment variable.

      Returns boolean

    • get generators(): {
          singularControllerNames: string[];
          createEntity(entityName: string): { path: string; name: string };
          importPath(...paths: string[]): string;
          tableName(entityName: string): string;
          modelName(entityName: string): string;
          modelFileName(entityName: string): string;
          controllerName(entityName: string, singular?: boolean): string;
          controllerFileName(entityName: string, singular?: boolean): string;
          eventName(entityName: string): string;
          eventFileName(entityName: string): string;
          listenerName(entityName: string): string;
          listenerFileName(entityName: string): string;
          middlewareName(entityName: string): string;
          middlewareFileName(entityName: string): string;
          providerName(entityName: string): string;
          providerFileName(entityName: string): string;
          policyName(entityName: string): string;
          policyFileName(entityName: string): string;
          factoryName(entityName: string): string;
          factoryFileName(entityName: string): string;
          serviceName(entityName: string): string;
          serviceFileName(entityName: string): string;
          seederName(entityName: string): string;
          seederFileName(entityName: string): string;
          commandTerminalName(entityName: string): string;
          commandName(entityName: string): string;
          commandFileName(entityName: string): string;
          validatorName(entityName: string): string;
          validatorActionName(entityName: string, action: string): string;
          validatorFileName(entityName: string): string;
          exceptionName(entityName: string): string;
          exceptionFileName(entityName: string): string;
          mailerName(entityName: string, type?: "notification" | "provision"): string;
          mailerFileName(
              entityName: string,
              type?: "notification" | "provision",
          ): string;
          mailName(entityName: string, type?: string): string;
          mailFileName(entityName: string, type?: string): string;
          testGroupName(entity: { path: string; name: string }): string;
          testFileName(entityName: string): string;
          viewFileName(entityName: string): string;
      }

      Reference to scaffolding generators for creating application files. Provides utilities for generating controllers, models, migrations, etc.

      Returns {
          singularControllerNames: string[];
          createEntity(entityName: string): { path: string; name: string };
          importPath(...paths: string[]): string;
          tableName(entityName: string): string;
          modelName(entityName: string): string;
          modelFileName(entityName: string): string;
          controllerName(entityName: string, singular?: boolean): string;
          controllerFileName(entityName: string, singular?: boolean): string;
          eventName(entityName: string): string;
          eventFileName(entityName: string): string;
          listenerName(entityName: string): string;
          listenerFileName(entityName: string): string;
          middlewareName(entityName: string): string;
          middlewareFileName(entityName: string): string;
          providerName(entityName: string): string;
          providerFileName(entityName: string): string;
          policyName(entityName: string): string;
          policyFileName(entityName: string): string;
          factoryName(entityName: string): string;
          factoryFileName(entityName: string): string;
          serviceName(entityName: string): string;
          serviceFileName(entityName: string): string;
          seederName(entityName: string): string;
          seederFileName(entityName: string): string;
          commandTerminalName(entityName: string): string;
          commandName(entityName: string): string;
          commandFileName(entityName: string): string;
          validatorName(entityName: string): string;
          validatorActionName(entityName: string, action: string): string;
          validatorFileName(entityName: string): string;
          exceptionName(entityName: string): string;
          exceptionFileName(entityName: string): string;
          mailerName(entityName: string, type?: "notification" | "provision"): string;
          mailerFileName(
              entityName: string,
              type?: "notification" | "provision",
          ): string;
          mailName(entityName: string, type?: string): string;
          mailFileName(entityName: string, type?: string): string;
          testGroupName(entity: { path: string; name: string }): string;
          testFileName(entityName: string): string;
          viewFileName(entityName: string): string;
      }

      • singularControllerNames: string[]

        List of controller names that should always be generated in singular form. These are typically system/admin controllers or special-purpose controllers that don't represent plural resources.

        // These will remain singular:
        // 'home' -> 'HomeController'
        // 'admin' -> 'AdminController'
        // 'auth' -> 'AuthController'
      • createEntity: function
        • Creates the entity path and name from user input. Parses the entity name to separate directory path from the actual name, handling file extensions and nested paths.

          Parameters

          • entityName: string

            The entity name which may include path and extension

          Returns { path: string; name: string }

          Object containing the parsed path and name

          createEntity('admin/users') // { path: 'admin', name: 'users' }
          createEntity('user.ts') // { path: './', name: 'user' }
          createEntity('profile') // { path: './', name: 'profile' }
      • importPath: function
        • Constructs a Unix-style import path from given path segments. Ensures consistent path separators regardless of the operating system.

          Parameters

          • ...paths: string[]

            Path segments to join

          Returns string

          Unix-style path string

          importPath('app', 'models', 'user') // 'app/models/user'
          
      • tableName: function
        • Converts an entity name to a database table name. Removes 'table' suffix, converts to model name format, then pluralizes and converts to snake_case.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Database table name in snake_case plural form

          tableName('User') // 'users'
          tableName('BlogPost') // 'blog_posts'
          tableName('UserTable') // 'users'
      • modelName: function
        • Converts an entity name to a model class name. Removes file extension and 'model' suffix, singularizes, and converts to PascalCase.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Model class name in PascalCase singular form

          modelName('users') // 'User'
          modelName('blog-posts') // 'BlogPost'
          modelName('user.model.ts') // 'User'
      • modelFileName: function
        • Converts an entity name to a model file name. Uses the model name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Model file name in snake_case with .ts extension

          modelFileName('User') // 'user.ts'
          modelFileName('BlogPost') // 'blog_post.ts'
      • controllerName: function
        • Converts an entity name to a controller class name. Removes file extension and 'controller' suffix, then applies singularization rules based on special names list or parameter.

          Parameters

          • entityName: string

            The entity name to convert

          • singular: boolean = false

            Force singular form regardless of special names

          Returns string

          Controller class name in PascalCase with 'Controller' suffix

          controllerName('users') // 'UsersController'
          controllerName('admin') // 'AdminController' (from singular list)
          controllerName('posts', true) // 'PostController' (forced singular)
      • controllerFileName: function
        • Converts an entity name to a controller file name. Uses the controller name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          • singular: boolean = false

            Force singular form for the controller name

          Returns string

          Controller file name in snake_case with .ts extension

          controllerFileName('users') // 'users_controller.ts'
          controllerFileName('admin') // 'admin_controller.ts'
      • eventName: function
        • Converts an entity name to an event class name. Removes file extension and 'event' suffix, then converts to PascalCase.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Event class name in PascalCase

          eventName('user-registered') // 'UserRegistered'
          eventName('order.event.ts') // 'Order'
      • eventFileName: function
        • Converts an entity name to an event file name. Uses the event name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Event file name in snake_case with .ts extension

          eventFileName('UserRegistered') // 'user_registered.ts'
          
      • listenerName: function
        • Converts an entity name to a listener class name. Removes file extension and 'listener' suffix, then converts to PascalCase.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Listener class name in PascalCase

          listenerName('send-email') // 'SendEmail'
          listenerName('notification.listener.ts') // 'Notification'
      • listenerFileName: function
        • Converts an entity name to a listener file name. Uses the listener name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Listener file name in snake_case with .ts extension

          listenerFileName('SendEmail') // 'send_email.ts'
          
      • middlewareName: function
        • Converts an entity name to a middleware class name. Removes file extension and 'middleware' suffix, then converts to PascalCase with 'Middleware' suffix.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Middleware class name in PascalCase with 'Middleware' suffix

          middlewareName('auth') // 'AuthMiddleware'
          middlewareName('cors.middleware.ts') // 'CorsMiddleware'
      • middlewareFileName: function
        • Converts an entity name to a middleware file name. Uses the middleware name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Middleware file name in snake_case with .ts extension

          middlewareFileName('Auth') // 'auth_middleware.ts'
          
      • providerName: function
        • Converts an entity name to a provider class name. Removes file extension and 'provider' suffix, singularizes, then converts to PascalCase with 'Provider' suffix.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Provider class name in PascalCase with 'Provider' suffix

          providerName('database') // 'DatabaseProvider'
          providerName('redis.provider.ts') // 'RedisProvider'
      • providerFileName: function
        • Converts an entity name to a provider file name. Uses the provider name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Provider file name in snake_case with .ts extension

          providerFileName('Database') // 'database_provider.ts'
          
      • policyName: function
        • Converts an entity name to a policy class name. Removes file extension, 'policy' and 'model' suffixes, singularizes, then converts to PascalCase with 'Policy' suffix.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Policy class name in PascalCase with 'Policy' suffix

          policyName('users') // 'UserPolicy'
          policyName('post.policy.ts') // 'PostPolicy'
      • policyFileName: function
        • Converts an entity name to a policy file name. Uses the policy name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Policy file name in snake_case with .ts extension

          policyFileName('User') // 'user_policy.ts'
          
      • factoryName: function
        • Converts an entity name to a factory class name. Removes file extension, 'factory' and 'model' suffixes, singularizes, then converts to PascalCase with 'Factory' suffix.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Factory class name in PascalCase with 'Factory' suffix

          factoryName('users') // 'UserFactory'
          factoryName('post.factory.ts') // 'PostFactory'
      • factoryFileName: function
        • Converts an entity name to a factory file name. Uses the factory name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Factory file name in snake_case with .ts extension

          factoryFileName('User') // 'user_factory.ts'
          
      • serviceName: function
        • Converts an entity name to a service class name. Removes file extension, 'service' and 'model' suffixes, singularizes, then converts to PascalCase with 'Service' suffix.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Service class name in PascalCase with 'Service' suffix

          serviceName('users') // 'UserService'
          serviceName('email.service.ts') // 'EmailService'
      • serviceFileName: function
        • Converts an entity name to a service file name. Uses the service name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Service file name in snake_case with .ts extension

          serviceFileName('User') // 'user_service.ts'
          
      • seederName: function
        • Converts an entity name to a seeder class name. Removes file extension, 'seeder' and 'model' suffixes, singularizes, then converts to PascalCase with 'Seeder' suffix.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Seeder class name in PascalCase with 'Seeder' suffix

          seederName('users') // 'UserSeeder'
          seederName('post.seeder.ts') // 'PostSeeder'
      • seederFileName: function
        • Converts an entity name to a seeder file name. Uses the seeder name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Seeder file name in snake_case with .ts extension

          seederFileName('User') // 'user_seeder.ts'
          
      • commandTerminalName: function
        • Converts an entity name to a command terminal name. Creates a namespaced command name using dash-case format, where the first part becomes the namespace and remaining parts are joined with colons.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Command terminal name in namespace:command format

          commandTerminalName('MakeUser') // 'make:user'
          commandTerminalName('DbSeed') // 'db:seed'
          commandTerminalName('Clear') // 'clear'
      • commandName: function
        • Converts an entity name to a command class name. Removes file extension and 'command' suffix, then converts to PascalCase.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Command class name in PascalCase

          commandName('make-user') // 'MakeUser'
          commandName('db.seed.command.ts') // 'DbSeed'
      • commandFileName: function
        • Converts an entity name to a command file name. Uses the command name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Command file name in snake_case with .ts extension

          commandFileName('MakeUser') // 'make_user.ts'
          
      • validatorName: function
        • Converts an entity name to a validator class name. Removes file extension and 'validator' suffix, singularizes, then converts to PascalCase.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Validator class name in PascalCase

          validatorName('users') // 'User'
          validatorName('create-post.validator.ts') // 'CreatePost'
      • validatorActionName: function
        • Converts an entity name and action to a validator action name. Creates a camelCase name by prefixing with action and suffixing with 'validator'.

          Parameters

          • entityName: string

            The entity name to convert

          • action: string

            The action name (e.g., 'create', 'update')

          Returns string

          Validator action name in camelCase

          validatorActionName('User', 'create') // 'createUserValidator'
          validatorActionName('BlogPost', 'update') // 'updateBlogPostValidator'
      • validatorFileName: function
        • Converts an entity name to a validator file name. Uses the validator name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Validator file name in snake_case with .ts extension

          validatorFileName('User') // 'user.ts'
          
      • exceptionName: function
        • Converts an entity name to an exception class name. Removes file extension and 'exception' suffix, then converts to PascalCase with 'Exception' suffix.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Exception class name in PascalCase with 'Exception' suffix

          exceptionName('validation-error') // 'ValidationErrorException'
          exceptionName('not-found.exception.ts') // 'NotFoundException'
      • exceptionFileName: function
        • Converts an entity name to an exception file name. Uses the exception name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Exception file name in snake_case with .ts extension

          exceptionFileName('ValidationError') // 'validation_error_exception.ts'
          
      • mailerName: function
        • Converts an entity name to a mailer class name. Removes file extension and various suffixes, then converts to PascalCase with the specified type suffix.

          Parameters

          • entityName: string

            The entity name to convert

          • type: "notification" | "provision" = 'notification'

            The mailer type ('notification' or 'provision')

          Returns string

          Mailer class name in PascalCase with type suffix

          mailerName('welcome-email') // 'WelcomeEmailNotification'
          mailerName('user-signup', 'provision') // 'UserSignupProvision'
      • mailerFileName: function
        • Converts an entity name to a mailer file name. Uses the mailer name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          • type: "notification" | "provision" = 'notification'

            The mailer type ('notification' or 'provision')

          Returns string

          Mailer file name in snake_case with .ts extension

          mailerFileName('WelcomeEmail') // 'welcome_email_notification.ts'
          
      • mailName: function
        • Converts an entity name to a class-based mail name. Removes file extension and various suffixes, then converts to PascalCase with the specified type suffix. Similar to mailerName but with more flexible type.

          Parameters

          • entityName: string

            The entity name to convert

          • type: string = 'notification'

            The mail type (default: 'notification')

          Returns string

          Mail class name in PascalCase with type suffix

          mailName('welcome') // 'WelcomeNotification'
          mailName('password-reset', 'email') // 'PasswordResetEmail'
      • mailFileName: function
        • Converts an entity name to a class-based mail file name. Uses the mail name and converts to snake_case with .ts extension.

          Parameters

          • entityName: string

            The entity name to convert

          • type: string = 'notification'

            The mail type (default: 'notification')

          Returns string

          Mail file name in snake_case with .ts extension

          mailFileName('Welcome') // 'welcome_notification.ts'
          mailFileName('PasswordReset', 'email') // 'password_reset_email.ts'
      • testGroupName: function
        • Converts an entity to a test group name. Creates a human-readable test group name by combining path and name, removing extensions and converting to sentence case.

          Parameters

          • entity: { path: string; name: string }

            Object containing path and name properties

          Returns string

          Test group name in sentence case

          testGroupName({ path: 'controllers', name: 'users' }) // 'Controllers users'
          testGroupName({ path: 'models', name: 'user.spec' }) // 'Models user'
      • testFileName: function
        • Converts an entity name to a test file name. Removes file extension and '.spec' suffix, converts to snake_case, then adds '.spec.ts' extension.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          Test file name in snake_case with .spec.ts extension

          testFileName('UserController') // 'user_controller.spec.ts'
          testFileName('auth-service.spec') // 'auth_service.spec.ts'
      • viewFileName: function
        • Converts an entity name to a view template file name. Removes file extension, converts to snake_case, and adds '.edge' extension for Edge template files.

          Parameters

          • entityName: string

            The entity name to convert

          Returns string

          View file name in snake_case with .edge extension

          viewFileName('UserProfile') // 'user_profile.edge'
          viewFileName('admin-dashboard') // 'admin_dashboard.edge'

    Methods

    • Switch the environment in which the app is running. The environment can only be changed before the app is booted.

      Parameters

      Returns this

      Returns the application instance for method chaining

      When called after the app has been booted

    • Specify the contents of the "adonisrc.js" file as an object. Calling this method will disable loading the "adonisrc.js" file from the disk.

      Parameters

      • value: Record<string, any>

        The RC file contents as an object

      Returns this

      Returns the application instance for method chaining

    • Define the config values to use when booting the config provider. Calling this method disables reading files from the config directory.

      Parameters

      • values: Record<any, any>

        The config values to use

      Returns this

      Returns the application instance for method chaining

    • Notify the parent process when the Node.js process is spawned with an IPC channel. The arguments accepted are same as "process.send"

      Parameters

      • message: any

        The message to send to the parent process

      • OptionalsendHandle: any

        Optional handle to send with the message

      • Optionaloptions: { swallowErrors?: boolean; keepOpen?: boolean }

        Options for sending the message

        • OptionalswallowErrors?: boolean

          Whether to swallow errors

        • OptionalkeepOpen?: boolean

          Whether to keep the connection open

      • Optionalcallback: (error: null | Error) => void

        Callback function to handle send result

      Returns void

    • Listen for a process signal. This method is same as calling "process.on(signal)"

      Parameters

      • signal: Signals

        The signal to listen for

      • callback: SignalsListener

        The callback to execute when signal is received

      Returns this

      Returns the application instance for method chaining

    • Listen for a process signal once. This method is same as calling "process.once(signal)"

      Parameters

      • signal: Signals

        The signal to listen for

      • callback: SignalsListener

        The callback to execute when signal is received

      Returns this

      Returns the application instance for method chaining

    • Listen for a process signal conditionally.

      Parameters

      • conditional: boolean

        Whether to register the listener

      • signal: Signals

        The signal to listen for

      • callback: SignalsListener

        The callback to execute when signal is received

      Returns this

      Returns the application instance for method chaining

    • Listen for a process signal once conditionally.

      Parameters

      • conditional: boolean

        Whether to register the listener

      • signal: Signals

        The signal to listen for

      • callback: SignalsListener

        The callback to execute when signal is received

      Returns this

      Returns the application instance for method chaining

    • Initiate the application. Calling this method performs following operations:

      • Parses the "adonisrc.js" file
      • Validate and set environment variables
      • Loads the application config from the configured config dir.
      • Configures the logger
      • Instantiates the IoC container

      Returns Promise<void>

      Promise that resolves when initiation is complete

    • Boot the application. Calling this method performs the following operations:

      • Resolve providers and call the "register" method on them.
      • Call the "boot" method on providers
      • Run the "booted" hooks

      Returns Promise<void>

      Promise that resolves when boot is complete

    • Start the application. Calling this method performs the following operations:

      • Run the "start" lifecycle hooks on all the providers
      • Start the application by invoking the supplied callback
      • Run the "ready" lifecycle hooks on all the providers
      • Run the "ready" application hooks

      Parameters

      • callback: (app: this) => void | Promise<void>

        The callback function to invoke when starting the app

      Returns Promise<void>

      Promise that resolves when start is complete

    • Terminate application gracefully. Calling this method performs the following operations:

      • Run "shutdown" hooks on all the providers
      • Run "terminating" app lifecycle hooks

      Returns Promise<void>

      Promise that resolves when termination is complete

    • Returns relative path to a file from the app root

      Parameters

      • absolutePath: string

        The absolute path to convert

      Returns string

      The relative path from app root

    • Returns URL to a path from the application root.

      Parameters

      • ...paths: string[]

        Path segments to join

      Returns URL

      The constructed URL

    • Returns file system path from the application root.

      Parameters

      • ...paths: string[]

        Path segments to join

      Returns string

      The constructed file system path

    • Makes path to the config directory

      Parameters

      • ...paths: string[]

        Path segments to append to config directory

      Returns string

      The constructed config directory path

    • Makes path to the public directory

      Parameters

      • ...paths: string[]

        Path segments to append to public directory

      Returns string

      The constructed public directory path

    • Makes path to the providers directory

      Parameters

      • ...paths: string[]

        Path segments to append to providers directory

      Returns string

      The constructed providers directory path

    • Makes path to the factories directory

      Parameters

      • ...paths: string[]

        Path segments to append to factories directory

      Returns string

      The constructed factories directory path

    • Makes path to the migrations directory

      Parameters

      • ...paths: string[]

        Path segments to append to migrations directory

      Returns string

      The constructed migrations directory path

    • Makes path to the seeders directory

      Parameters

      • ...paths: string[]

        Path segments to append to seeders directory

      Returns string

      The constructed seeders directory path

    • Makes path to the language files directory

      Parameters

      • ...paths: string[]

        Path segments to append to language files directory

      Returns string

      The constructed language files directory path

    • Makes path to the views directory

      Parameters

      • ...paths: string[]

        Path segments to append to views directory

      Returns string

      The constructed views directory path

    • Makes path to the start directory

      Parameters

      • ...paths: string[]

        Path segments to append to start directory

      Returns string

      The constructed start directory path

    • Makes path to the tmp directory

      Parameters

      • ...paths: string[]

        Path segments to append to tmp directory

      Returns string

      The constructed tmp directory path

    • Makes path to the contracts directory

      Parameters

      • ...paths: string[]

        Path segments to append to contracts directory

      Returns string

      The constructed contracts directory path

      Use "types" directory instead

    • Makes path to the http controllers directory

      Parameters

      • ...paths: string[]

        Path segments to append to http controllers directory

      Returns string

      The constructed http controllers directory path

    • Makes path to the models directory

      Parameters

      • ...paths: string[]

        Path segments to append to models directory

      Returns string

      The constructed models directory path

    • Makes path to the services directory

      Parameters

      • ...paths: string[]

        Path segments to append to services directory

      Returns string

      The constructed services directory path

    • Makes path to the exceptions directory

      Parameters

      • ...paths: string[]

        Path segments to append to exceptions directory

      Returns string

      The constructed exceptions directory path

    • Makes path to the mailers directory

      Parameters

      • ...paths: string[]

        Path segments to append to mailers directory

      Returns string

      The constructed mailers directory path

    • Makes path to the mails directory

      Parameters

      • ...paths: string[]

        Path segments to append to mails directory

      Returns string

      The constructed mails directory path

    • Makes path to the middleware directory

      Parameters

      • ...paths: string[]

        Path segments to append to middleware directory

      Returns string

      The constructed middleware directory path

    • Makes path to the policies directory

      Parameters

      • ...paths: string[]

        Path segments to append to policies directory

      Returns string

      The constructed policies directory path

    • Makes path to the validators directory

      Parameters

      • ...paths: string[]

        Path segments to append to validators directory

      Returns string

      The constructed validators directory path

    • Makes path to the commands directory

      Parameters

      • ...paths: string[]

        Path segments to append to commands directory

      Returns string

      The constructed commands directory path

    • Makes path to the events directory

      Parameters

      • ...paths: string[]

        Path segments to append to events directory

      Returns string

      The constructed events directory path

    • Makes path to the listeners directory

      Parameters

      • ...paths: string[]

        Path segments to append to listeners directory

      Returns string

      The constructed listeners directory path

    • Makes path to the client directory for writing generated output

      Parameters

      • ...paths: string[]

        Path segments to append to events directory

      Returns string

      The constructed directory path

    • Makes path to the server directory for writing generated output

      Parameters

      • ...paths: string[]

        Path segments to append to events directory

      Returns string

      The constructed directory path

    • Import a module by identifier. This method uses the importer function defined at the time of creating the application instance and throws an error if no importer was defined.

      Parameters

      • moduleIdentifier: string

        The module identifier to import

      Returns any

      The imported module

      When no importer function is defined

    • Import a module by identifier and return its default export. This method uses the importer function defined at the time of creating the application instance and throws an error if no importer was defined.

      Type Parameters

      • T extends object

        The type of the default export

      Parameters

      • moduleIdentifier: string

        The module identifier to import

      Returns Promise<T extends {} ? A : never>

      The default export of the imported module

      When no importer function is defined

    • JSON representation of the application

      Returns {
          isReady: boolean;
          isTerminating: boolean;
          environment: AppEnvironments;
          nodeEnvironment: string;
          appName: any;
          version: null | string;
          adonisVersion: null | string;
      }

      The application state as a JSON object