< Service-template-node
Configuration
The first thing you should configure is the service's general information (name, description, etc.). Open up package.json and change (at least) the following fields:
nameversiondescriptionrepository/urlkeywordsauthorcontributorslicencebugshomepage
Now change the service's name in config.dev.yaml and config.prod.yaml. While you are there, you might want to look at and play with other configuration parameters, such as:
num_workers- the number of workers to start; some special values are:0will not do any forking, but run the service in the master processncpuwill spawn as many worker processes as there are CPU cores on the host
worker_heap_limit_mb- the maximum amount of memory (in MB) a worker's heap can haveloggingandmetrics- the configuration for logging and metrics facilitiesservices- the block instructing the master process which services to start; there can be more than one service, if, e.g., your service depends on another Node.js service being present; each service has further the following information:name- the service's namemodule- the module starting the service; if not given, the service's name is used insteadconf- the configuration object passed directly to the service; settings to consider (remember to update them in bothconfig.dev.yamlas well asconfig.prod.yaml):port- the port to start the service on (default:8888)interface- where to bind the service's server (default:0.0.0.0)- you may add here any other configuration options needed by your service, as long as it is valid YAML; these will be accessible via the
app.confobject
For more information on configuration possibilities, take a look at the service-runner documentation.
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.