A bare bones starter template for a node gRPC micro service
https://github.com/bryopsida/node-grpc-starter.git
A bare bones Node.JS gRPC starter template. It does not use typescript, it does not use any additional frameworks.
It provides boilerplate to start a gRPC microservice using an example echo service .proto file and dynamic bindings.
node --test is used for testing instead of bringing in a library/framework.
Scripts available in package.json
build:image builds a docker imagebuild:docs builds the docs folder using jsdocbuild:context creates a folder showing the files sent to the docker build context under the context folderlint runs standard lint checkslint:fix fixes all auto correctable lint failuresstart runs the serverstart:dev runs the server using nodemon and reloads on changetest runs testsA github workflow is included that
| Name | Description | Default |
|---|---|---|
| SERVERPORT | Bind port of the server | 3000 |
| SERVERCACERT | String value of the CA in PEM format | |
| SERVERKEYPAIRS | JSON array, each object containing a key and cert property | |
| SERVERVALIDATECLIENTCERT | Boolean toggling whether or not the server will validate the client certificate, when set to true this enables mTLS | false |
| SERVERSUPRESSINSECUREWARNING | When running without TLS a warning is logged, setting this to true disables that log message | false |
| DOTENVFILEPATHS | Comma seperated list of paths to .env files, if not provided .env is used, encrypted files should have a .vault ending extension | |
| DOTENVDEBUG | When enabled debug messages from dotenv are logged | false |
| DOTENVVAULTKEYPATH | When set, this path is used to load a key for decrypting .vault dotenv files, when set has priority over DOTENVVAULTKEY | |
| DOTENVVAULTKEY | When set, this is used to decrypt .vault dotenv files | |
| DOTENVOVERRIDE | When set to true, values specified in .env files will override values already defined in the destination | false |
A renovate configuration is provided to keep dependencies up to date and auto merge if tests pass.