Initial scaffold
This commit is contained in:
9
packages/embedding-service/package.json
Normal file
9
packages/embedding-service/package.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "@loom/embedding-service",
|
||||
"version": "1.0.0",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"start": "node src/index.js",
|
||||
"dev": "node --watch src/index.js"
|
||||
}
|
||||
}
|
||||
9
packages/inference-service/package.json
Normal file
9
packages/inference-service/package.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "@loom/inference-service",
|
||||
"version": "1.0.0",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"start": "node src/index.js",
|
||||
"dev": "node --watch src/index.js"
|
||||
}
|
||||
}
|
||||
12
packages/memory-service/package.json
Normal file
12
packages/memory-service/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "memory-service",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
}
|
||||
9
packages/orchestration-service/package.json
Normal file
9
packages/orchestration-service/package.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "@loom/orchestration-service",
|
||||
"version": "1.0.0",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"start": "node src/index.js",
|
||||
"dev": "node --watch src/index.js"
|
||||
}
|
||||
}
|
||||
7
packages/shared/package.json
Normal file
7
packages/shared/package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
{
|
||||
"name": "@loom/shared",
|
||||
"version": "1.0.0",
|
||||
"main": "src/index.js",
|
||||
"scripts": {}
|
||||
}
|
||||
17
packages/shared/src/config/env.js
Normal file
17
packages/shared/src/config/env.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// A simple utility to load environment variables from a .env file
|
||||
// Each service calls this at startup to load its configuration
|
||||
|
||||
function getEnv(key, defaultValue){
|
||||
const value = process.env[key];
|
||||
|
||||
//check if the desired value exists, if not check if a default value was provided, if not throw an error
|
||||
if (value === undefined) {
|
||||
if (defaultValue === undefined) {
|
||||
throw new Error(`Missing required environment variable: ${key}`);
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
module.exports = {getEnv};
|
||||
3
packages/shared/src/index.js
Normal file
3
packages/shared/src/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const {getEnv} = require('./config/env');
|
||||
|
||||
module.exports = {getEnv};
|
||||
Reference in New Issue
Block a user