Note: while we currently use the same database for testing and production, this will change in the future. Be cognizant of this change when it comes to protect our data Configuring WSL development
- Open a command prompt in WSL (either from the Start Menu or from VS Code will do).
- Type
nano ~/.bashrc
to edit your user's .bashrc file. This file is executed when you first log into WSL. - Navigate to the end of the file using your arrow keys.
- Paste the following line at the end of the file, replacing
{MONGO_URI}
with the URI provided to you as such:
export REDALLIANCEDBKEY="{MONGO_URI}"
- Press Ctrl-x, y, and then enter to save your changes and exit
- In the terminal prompt run
source ~/.bashrc
to apply the changes.
The next time you start the API, the key will be provided to the application and it will be able to connect to the MongoDB instance.
Configuring Docker development
The Docker development environment is configured through VS code. We will edit a file to provide the docker container with the correct environment variable.
- Obtain the MongoDB connection URI from the Titan Scouting lead.
- Open VS Code and open the API source code folder. DO NOT reopen the folder in container if prompted.
- Expand the .devcontainer folder
- Create a file named
.env
- In this file, type this, replacing
{MONGO_URI}
with the URI provided to you as such:
REDALLIANCEDBKEY="{MONGO_URI}"
- Click the green remote connections button on the bottom left of the screen, and click
Remote Container: Reopen in Container
, and wait for the container to build and open your development environment.
2020-2022, Titan Scouting Revision
a853353