-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make issuer and verifier input more dynamic
Fixes #15 Signed-off-by: Mirko Mollik <[email protected]>
- Loading branch information
Mirko Mollik
committed
May 1, 2024
1 parent
5918431
commit 7ee6e5f
Showing
13 changed files
with
617 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Joi from 'joi'; | ||
import 'dotenv/config'; | ||
|
||
/** | ||
* Define the environment variables schema | ||
*/ | ||
const envVarsSchema = Joi.object() | ||
.keys({ | ||
PORT: Joi.number().default(3000), | ||
CONFIG_RELOAD: Joi.boolean().default(false), | ||
ISSUER_BASE_URL: Joi.string().required(), | ||
NODE_ENVIRONMENT: Joi.string() | ||
.valid('development', 'production') | ||
.default('development'), | ||
}) | ||
.unknown(); | ||
|
||
const { error, value: envVars } = envVarsSchema.validate(process.env); | ||
|
||
if (error) { | ||
throw new Error(`Config validation error: ${error.message}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Joi from 'joi'; | ||
import 'dotenv/config'; | ||
|
||
/** | ||
* Define the environment variables schema | ||
*/ | ||
const envVarsSchema = Joi.object() | ||
.keys({ | ||
PORT: Joi.number().default(3000), | ||
CONFIG_RELOAD: Joi.boolean().default(false), | ||
VERIFIER_BASE_URL: Joi.string().required(), | ||
NODE_ENVIRONMENT: Joi.string() | ||
.valid('development', 'production') | ||
.default('development'), | ||
}) | ||
.unknown(); | ||
|
||
const { error, value: envVars } = envVarsSchema.validate(process.env); | ||
|
||
if (error) { | ||
throw new Error(`Config validation error: ${error.message}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.