- Download this repository OR clone this repository to your machine.
-
Open a terminal at the root directory of this repository.
-
If you have an anaconda environment called
snake-game
and you do not wish to replace it, go toenvironment.yml
and change the name of the environment on the first line:name: snake-game
-
Create an anaconda environment with the
environment.yml
file:conda env create -f environment.yml
ℹ The environment.yml
was created withconda env export --from-history > environment.yml
⚠ If the command conda
cannot be found, you can either add the anaconda binaries folder to system path, or open the terminal from anaconda navigator by clicking the triangle icon next to thebase
environment -
Activate the environment (replace
snake-game
with your environment name if you have changed it in step 2):conda activate snake-game
-
Open a terminal at the root directory of this repository.
-
[Optional] Create a virtual environment called
snake-game
to avoid messing with your python installation.python -m venv snake-game
Activate the virtual environment
POSIX (Linux/macOS):
source snake-game/bin/activate
Windows (cmd.exe):
snake-game\Scripts\activate.bat
Windows (PowerShell):
snake-game\Scripts\Activate.ps1
-
Install the required libraries.
pip install -r environment.txt
ℹ The environment.txt
was created withpip list --format=freeze > environment.txt
-
Activate the environment if it is not activated yet.
-
Change into the
app
directory.cd app
-
Run the server with:
uvicorn server:app --reload
The terminal output will display this if the server is started correctly. You may have a different URL.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) INFO: Started reloader process [28720] INFO: Started server process [28722] INFO: Waiting for application startup. INFO: Application startup complete.
-
Open your browser, go to the URL that has been provided in the terminal.
-
Append
/docs
to the end of the local server URL. For instance, if the URL is http://127.0.0.1:8000, then go to http://127.0.0.1:8000/docs