Host Library Microservice
The lib microservice is a simplified file manager providing graphQL API. It has three features:
- provide a listing of directory contents.
- transfer a file to user.
- Source files can either come from local file system or from a gitlab instance.
The library microservice is designed to manage and serve files, functions, and models to users, allowing them to access and interact with various resources.
This document provides instructions for running a stand alone library microservice.
Setup the File System
The users expect the following file system structure for their reusable assets.
There is a skeleton file structure in DTaaS codebase. You can copy and create file system for your users.
Install
The package is available in Github packages registry and on npmjs.
Set the registry and install the package with the one of the two following commands
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.
Configure
The microservices requires config specified in INI format. The template configuration file is:
The LOCAL_PATH
variable is the absolute filepath to the
location of the local directory which will be served to users
by the Library microservice.
Replace the default values the appropriate values for your setup.
Use
Display help.
The config is saved .env
file by convention. The libms looks for
.env
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 .env
,
for example as .env.development
, 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, functions, and models.
Service Endpoint
The URL endpoint for this microservice is located at: localhost:PORT/lib
The service API documentation is available on user page.