39 lines
1.6 KiB
JavaScript
39 lines
1.6 KiB
JavaScript
|
// Identity. Store your memories and mental belongings
|
||
|
// Copyright (C) 2024 Sofía Aritz
|
||
|
//
|
||
|
// This program is free software: you can redistribute it and/or modify
|
||
|
// it under the terms of the GNU Affero General Public License as published
|
||
|
// by the Free Software Foundation, either version 3 of the License, or
|
||
|
// (at your option) any later version.
|
||
|
//
|
||
|
// This program is distributed in the hope that it will be useful,
|
||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
// GNU Affero General Public License for more details.
|
||
|
//
|
||
|
// You should have received a copy of the GNU Affero General Public License
|
||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||
|
|
||
|
import "dotenv/config";
|
||
|
|
||
|
const REQUIRED_VARS = [
|
||
|
"ASSET_API_ASSETS_FOLDER",
|
||
|
"ASSET_API_IDENTITY_API_ENDPOINT"
|
||
|
];
|
||
|
|
||
|
REQUIRED_VARS.forEach((element) => {
|
||
|
if (
|
||
|
process.env[element] == null ||
|
||
|
(typeof process.env[element] === "string" && process.env[element].length === 0)
|
||
|
) {
|
||
|
console.error(`Required environment variable was not set: ${element}`);
|
||
|
process.exit(1);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
export const ASSET_API_LANDING_MESSAGE = process.env["ASSET_API_LANDING_MESSAGE"] || "asset-api v0.0.1";
|
||
|
export const LISTEN_PORT = Number(process.env["ASSET_API_LISTEN_PORT"]) || 3001;
|
||
|
export const ASSETS_FOLDER = process.env["ASSET_API_ASSETS_FOLDER"];
|
||
|
export const IDENTITY_API_ENDPOINT = process.env["ASSET_API_IDENTITY_API_ENDPOINT"];
|
||
|
export const M2M_ALGORITHM = process.env["ASSET_API_M2M_ALGORITHM"] || "RSA-SHA512";
|