@autofleet/node-common v1.5.0
AutoFleet Node Common
This respostory is made in order have as much of common code as we can.
Each line of code used in wrriten in this repo will be used in the enetire AutoFleet system.
Make sure you have:
- Tests
- Docs
Consts
Currently we suppurt:
{
'OK'
'ERROR'
'FAIL'
}
Network
Server 2 Servers communication.
Implemented:
- Retriving service urls from environment
- Retry - Using https://github.com/softonic/axios-retry
- Caching - TBD
- Syntatic response for fail - TBD
- Circuit Breaking - TBD
The API is just like axios api but the creation of new instance must have either serviceName
or serviceUrl
in options.
In case serviceName
used the constractor will look for an environment varible with the the name <SERVICE_NAME>_SERVICE_HOST
.
For Example:
const { Network } = require('@autofleet/node-common');
n = new Network({ serviceName: 'TEST' });
n.get('/posts/1');
.env file:
RIDE_SERVICE_HOST=jsonplaceholder.typicode.com
To learn more click here.
Settings
Adding settings
For adding new setting you need to add it to the map.js file, please specify
- name - descriptive name
- description - few words about what it does + unit
- type - supportable types: 'number', 'string', 'json'
- defaultValue - default value
- context - 'security' and 'operation' will not show in the simulator configuration
See example.
DeLorean
Use this model to mock time on server - more info TBD.
Publish package
bump the version number in package.json and run
npm publish
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago