2021-03-04 10:36:16 -05:00
|
|
|
# Links Backend
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
1. Install Python 3.
|
|
|
|
|
|
|
|
2. Run the following commands inside the backend folder:
|
|
|
|
```
|
|
|
|
python3 -m venv venv
|
2021-03-04 11:19:00 -05:00
|
|
|
venv/Scripts/activate
|
2021-03-04 10:36:16 -05:00
|
|
|
pip install -r requirements.txt
|
|
|
|
python main.py
|
|
|
|
```
|
2021-03-04 11:19:00 -05:00
|
|
|
|
|
|
|
If you are on Windows, run `venv\Scripts\activate` instead, for the second command.
|
2021-03-04 11:19:22 -05:00
|
|
|
|
2021-03-04 10:36:16 -05:00
|
|
|
3. Go to `localhost:5000` in your web browser and you should see "Hello, World!".
|
|
|
|
|
|
|
|
## (Optional) Exercises
|
|
|
|
|
|
|
|
- Install Postman (https://www.postman.com/downloads/) and use it make a request to this web server.
|
|
|
|
- Add a new GET route at `/test` that shows "A new route".
|
2021-03-04 11:19:00 -05:00
|
|
|
- Add a new POST route at `/post` that accepts a JSON body, and shows the `foo` key of the JSON.
|