
LabShare Services
Usage
npm i @labshare/services
const {Services} = require('@labshare/services');
let options = {
};
let services = new Services(options);
services.config(({app, services}) => {
app.use(compression());
});
services.start();
Configuration
LabShare Service Plugins
Example plugin usage
const {Services} = require('@labshare/services');
const servicesAuth = require('@labshare/services-auth');
const services = new Services({);
services.config(servicesAuth({}));
Default HTTP Routes
Versions
GET /<service-path>/versions
Response
{
"buildVersion":"v2017.0914.5",
"versions": [
{"api":"ls", apiDetails":{"name":"labshare","version":"v0.17.0631","description":"LabShare Services"}}
]
}
Example:
http://localhost:8000/versions
API Explorer
GET /<service-path>/explorer
Response
Swagger HTML page providing documentation for endpoints across all API packages
Example:
http://localhost:8000/explorer
Working with LabShare APIs
Development
- Install Node.js.
npm i -g lsc
- Run
npm install
inside the Service's root directory to install its dependencies.
Tests
npm test
-@2x.png)