toolbox-api
v1.0.61
Published
Toolbox API used by Boappa services
Downloads
24
Readme
Toolbox API
A simple toolbox to build your API without much magic.
Example
TODO: ...
You could also use the utils directly, this is a toolbox not something opinionated on which you should be restrained.
Development
Install
- Install Node.js
- On the CLI, run
npm install -g typescript
(this will help with some modules) - On the CLI, on the project folder run
npm install --save toolbox-api
Run documentation
To run the documentation
npm run start-docs
General working guide
Working with the config
default.json
is the first file imported and as per name has all the defaults of the application. After loading this file, the system will load the file with the name of the NODE_ENV
. If you have NODE_ENV=production
then production.json
will be loaded on top of the default configuration.
To setup a config, you should follow the instructions from node-config. When you initialize the config module, you can also pass an extension interface for the config.
Create a new service
For you to be able to add a new service follow these steps:
TODO: ...
Routing
TODO: ...
Using the logger
You shouldn't use console.*
because these can't be treated / parsed or go to a file for example. For this reason, a logger exists.
TODO: ...