There are 2 ways to manage Actionhero configuration: configuration files and overrides. In both cases, Actionhero starts by reading the config in ./config/
. Here is what config files for a new Actionhero project look like.
The normal way to deal with configuration changes is to use the files in /config/
and to have changed options for each environment, based on NODE_ENV. First we load in all settings from the default
config block, and then we replace those with anything defined in the relevant environment
section. Actionhero uses the standard node environment variable NODE_ENV
to determine environment, and defaults to ‘development' when one isn't found. This pattern is very similar the Rails and Sails frameworks. A good way to visualize this is to note that, by default, the server will return metadata in response JSON, but we change that in the production NODE_ENV and disable it.
export const DEFAULT = {
general: () => {
return {
//...
developmentMode: true,
//...
};
},
};
export const production = {
general: () => {
return {
developmentMode: false,
};
},
};
The priority order of configs is:
/config
/config
When building config files of your own, note that an export const DEFAULT
is always required, and any environment overrides are optional. What is exported is a hash which eventually resolves a synchronous function.
When launching Actionhero you can specify which config directory to use with --config '/path/to/dir'
or the environment variable ACTIONHERO_CONFIG
, otherwise ./config/
will be used from your working directory.
The priority of arguments is:
./config
folder, if it exists.actionhero --config=PATH1 --config=PATH2 --config=PATH3,PATH4
ACTIONHERO_CONFIG=PATH1,PATH2 npm start
Note that if --config
or ACTIONHERO_CONFIG
are used, they overwrite the use of the default /config
folder. If you wish to use both, you need to re-specify "config", e.g. --config=config,local-config
. Also, note that specifying multiple --config
options on the command line does exactly the same thing as using one parameter with comma separators, however the environment variable method only supports the comma-delimited syntax.
The Actionhero server is open source, under the Apache-2 license
Actionhero runs on Linux, OS X, and Windows
You always have access to the Actionhero team via Slack and Github
We provide support for corporate & nonprofit customers starting at a flat rate of $200/hr. Our services include:
We have packages appropriate for all company sizes. Contact us to learn more.
We provide support for corporate & nonprofit customers starting at a flat rate of $200/hr. Our services include:
We have packages appropriate for all company sizes. Contact us to learn more.
For larger customers in need of a support contract, we offer an enterprise plan including everything in the Premium plan plus: