BohemiaInteractive/bi-service

View on GitHub
tutorials/1.md

Summary

Maintainability
Test Coverage

[bi-service-template](https://github.com/BohemiaInteractive/bi-service-template) plugin should help you get running. It generates working project skeleton based on minimal user input.  

Here is basic project file system structure:

- `config/`
- `config/<NODE_ENV>/config.json5`
    - service configuration
- `lib/`
- `lib/database/`
    - by convention, not required
- `lib/routes/`
    - by convention, not required
    - contents of the directory will be recursivelly loaded at service startup.
- `lib/routes/v1.0/`
- `lib/routes/v1.0/<app_name>/`
- `lib/app.js`
    - is expected to export the {@link AppManager} instance
    - A service can have multiple applications running on different ports.
- `logs/`
    - when logging into the fs
- `index.js`
    - is expected to export the {@link Service} instance


A service can be run by `npm start` or by `./node_modules/.bin/bi-service run` command respectively.  
See {@tutorial 2.CLI-interface} for list of options.  

A {@link Service} instance holds the main representation of a running web service. It's aware of {@link AppManager} with {@link App Apps} each running at different TCP port. Also the service object has access to essential {@link ResourceManager} & {@link RemoteServiceManager} & [Service Config](https://github.com/BohemiaInteractive/bi-config)