Add a new dependency to the wrapper's package.json the way you would for any npm package:.Each services can override and extend the defaults in its own options stanza. this can be useful if you want each process to bind to a different port, e.g., 800%i.ĭefaults for all services are in the top-level env and args fields.%i: %i is a place-holder for the process # if you're running multiple processes.useful for taking advantage of multiple cpus, defaults to 1 process.processes: how many copies of the service should be run.args: command-line-arguments available to the script executed by the ndm wrapper.env: string environment variables available within the script executed by the ndm wrapper.When generating service wrappers the start script is used. scripts: scripts that can be executed by ndm.description: description of the service.If no module is specified, the key of the service will be used as the module name to look for. module: the name of the npm module that should be the working directory for the service."description": "baby animal thumbnailing service ", Then a service.json file describes how to run each service. Each service you want to run with ndm should be packaged as its own separate npm module that the ndm wrapper depends on. It's structured like an npm package, with a package.json file listing its dependencies. Ndm can run a single services or a collection of services. Start the service wrappers you've just generated: ndm start.When you're ready, generate service wrappers (upstart, initctl, etc): ndm install.Edit service.json to add appropriate args and envs for your server.Add service dependencies to your package.json: npm install my-service-module -save.Create a project directory with a package.json: npm init. You might need to run that as root with sudo.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |