IMidwayExpressApplication
Hierarchy
- IMidwayApplication<Context, ExpressApplication>
- IMidwayExpressApplication
Callable
Index
Methods
addConfigObject
Add new value to current config
createAnonymousContext
create a context with RequestContainer
createLogger
Create a logger by name and options
getAppDir
Get a project root directory, without src or dist
getApplicationContext
Get global Midway IoC Container
getAttr
Get value from app attribute map
Type parameters
- T
getBaseDir
Get a base directory for project, with src or dist
getConfig
Get all configuration values or get the specified configuration through parameters
getCoreLogger
Get core logger
getEnv
Get a environment value, read from MIDWAY_SERVER_ENV
getFramework
get current related framework
getFrameworkType
getLogger
Get default logger object or get the specified logger through parameters
getMiddleware
get global middleware
Type parameters
- Response
- NextFunction
getNamespace
get current namespace
getProcessType
Get current running process type, app or agent, just for egg
getProjectName
Get project name, just package.json name
setAttr
Set value to app attribute map
setContextLoggerClass
Set a context logger class to change default context logger format
useFilter
add exception filter
Type parameters
- R
- N
useGuard
add global guard
useMiddleware
mount router and middleware
Type parameters
- Response
- NextFunction
Express instance itself is a request handler, which could be invoked without third argument.