Project Lockdown (an initiative from The IO Foundation) is a civic tech, interactive platform providing an overview of the state of Human and Digital Rights around the globe. It evaluates policies obtained from official sources that may impact their observance. It provides, among other tools, a layered map interface that allows for a visual representation of the policies adopted, assisting a broad range of stakeholders in understanding the global state of their Rights. This empowers them to become active agents of global change.
@jeff-knurek
As you said the config will be read from environment variables, I made some changes to config.ts file.
It will:
load environment variables from .env file in API folder.
create config objects: dbConnection, appConfig from environment variables.
File .sample-env is added as a reference in the Reference folder.
Some dependencies are added in package.json:
@types/node to be able to use process.env (reading environment variables).
dotenv to load .env file.
Config.test.ts is the unit test file for config.ts
I don't explicitly test dotenv - loading .env file. If the test passes, it means .env is loaded successfully. Otherwise, there will be an error if there is no .env file
The test will make sure config objects have all required fields in the right type.
In the future, if there is more config, what we need to do are adding new key-value pair to .env, and adding new code/objects to config.ts
@jeff-knurek As you said the config will be read from environment variables, I made some changes to config.ts file. It will:
File .sample-env is added as a reference in the Reference folder.
Some dependencies are added in package.json:
Config.test.ts is the unit test file for config.ts
In the future, if there is more config, what we need to do are adding new key-value pair to .env, and adding new code/objects to config.ts