Skip to content

mapleknight/services

 
 

Repository files navigation

Greenkeeper badge Coverage Status Build Status semantic-release codecov

LabShare Services

Usage

npm i @labshare/services

const {Services} = require('@labshare/services');

let options = {
    // Override default options. 
    // The available configuration options are described in the "Configuration" section below.
};

let services = new Services(options);

services.config(({app, services}) => {
   // Optionally perform additional customization of the Express app initialized by Services and the loaded routes
   // Example (adds Express.js compression middleware):
   app.use(compression());
});

// Start up the server with all the loaded HTTP and Socket APIs
services.start();

Configuration

LabShare Service Plugins

Example plugin usage

const {Services} = require('@labshare/services');
const servicesAuth = require('@labshare/services-auth');

const services = new Services({/* options */);

services.config(servicesAuth({/* options */}));

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

Endpoints

GET /<service-path>/<project-name>/endpoints
POST /<service-path>/<project-name>/endpoints

Response

HTML table with the HTTP routes of the provided project name.

Example: http://localhost:8000/services/endpoints

Working with LabShare APIs

Development

  1. Install Node.js.
  2. npm i -g lsc
  3. Run npm install inside the Service's root directory to install its dependencies.

Tests

npm test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.3%
  • Other 0.7%