AppInfo

AppInfo

new AppInfo()

Meta information of the application

Source:

Members

baseDir :String

The current directory, where the application code is.

Source:

env :String

The environment of the application, it's not NODE_ENV

  1. from $baseDir/config/env
  2. from EGG_SERVER_ENV
  3. from NODE_ENV
env description
test system integration testing
prod production
local local on your own computer
unittest unit test
Source:
See:

HOME :String

The use directory, same as process.env.HOME

Source:

name :String

The name of the application, retrieve from the name property in package.json.

Source:

pkg :Object

parsed from package.json

Source:

root :String

The directory whether is baseDir or HOME depend on env. it's good for test when you want to write some file to HOME, but don't want to write to the real directory, so use root to write file to baseDir instead of HOME when unittest. keep root directory in baseDir when local and unittest

Source: