This exercise is for Backend session in Seed: Zero.
To make sure you understand the material, there are some requirements:
- Backend is runnable.
- Backend has a top-level endpoint
/
- Backend can calculate a simple math in the path
/calculator
Name | Version |
---|---|
Python | 3.9 |
-
Fork this repository.
-
Clone the project to your local machine. Open a terminal first and go to some directory.
git clone https://github.com/{your-github-account}/seed-zero-backend.git
- Go to your cloned directory in your machine
cd seed-zero-backend
- use python virtual environment
python -m venv venv
- Use the virtual environment
- for MacOS/Linux
source venv/bin/activate
- for Windows
.\venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Run the app
uvicorn main:app --reload
- Edit code in
#TODO
inapp.py
- Test whether your code works by open these url in your browser.
- http://localhost:8000/ should display your text
- http://localhost:8000/calculator?first_number=1&second_number=2 should display 3
- Upload your work
git add .
git commit -m "Finish work"
git push
- Open Pull Request in this repository.
- Go to your opened Pull Request and click the link in comment.
- Download this project as zip in the green button with text "Code", select Download ZIP.
- Extract file and open a terminal in the project's directory. use python virtual environment
python -m venv venv
- Use the virtual environment
- for MacOS/Linux
source venv/bin/activate
- for Windows
.\venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Run the app
uvicorn main:app --reload
- Edit code in
#TODO
inapp.py
- Test whether your code works by open these url in your browser.
- http://localhost:8000/ should display your text
- http://localhost:8000/calculator?first_number=1&second_number=2 should display 3
- Finish!