Host Library Microservice
The lib microservice is a simplified file manager that serves files over GraphQL and HTTP API.
It has two features:
- Provide a listing of directory contents.
- Upload and download files
This document provides instructions for installing the npm package of the library microservice and running the same as a standalone service.
Setup the File System
Outside the DTaaS Platform
The package can be used independently of the DTaaS. In this use case, no specific file structure is required. Any valid file directory is sufficient.
Inside the DTaaS Platform
The users of the DTaaS expect the following file system structure for their reusable assets.

A skeleton file structure is available in the DTaaS codebase. This can be copied to create a file system for users.
Install
The npm package is available in Github packages registry and on npmjs. Prefer the package on npmjs over Github.
Set the registry and install the package with the one of the two following commands
npmjs
Github
The github package registry asks for username and password. The username is your Github username and the password is your Github personal access token. In order for the npm to download the package, your personal access token needs to have read:packages scope.
Use
Display help.
Both the options are not mandatory.
Please see configuration for explanation of
configuration conventions.
The config is saved libms.yaml file by convention. If -c is not specified
The libms looks for
libms.yaml file in the working directory from which it is run.
If you want to run libms without explicitly specifying the configuration
file, run
To run libms with a custom config file,
If the environment file is named something other than libms.yaml,
for example as libms-config.yaml, you can run
You can press Ctl+C to halt the application.
If you wish to run the microservice in the background, use
The lib microservice is now running and ready to serve files.
Protocol Support
The libms supports GraphQL protocol by default. This microservice can also serve files in a browser with files transferred over HTTP protocol.
This option needs to be enabled with -H http.json flag.
A sample http config provided here can be used.
The regular file upload and download options become available.
Service Endpoints
The GraphQL URL: localhost:PORT/lib
The HTTP URL: localhost:PORT/lib/files
The service API documentation is available on user page.