-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from tecladocode/develop
A few upgrades and fixes!
- Loading branch information
Showing
304 changed files
with
10,789 additions
and
16,154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"githubPullRequests.ignoredPullRequestBranches": [ | ||
"develop" | ||
] | ||
} |
11 changes: 0 additions & 11 deletions
11
docs/docs/01_course_intro/01_curriculum_overview/README.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
docs/docs/03_first_rest_api/03_first_rest_api_endpoint/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
docs/docs/03_first_rest_api/08_return_data_from_rest_api/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
6 changes: 6 additions & 0 deletions
6
docs/docs/04_docker_intro/02_run_docker_container/end/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM python:3.10 | ||
EXPOSE 5000 | ||
WORKDIR /app | ||
RUN pip install flask | ||
COPY . . | ||
CMD ["flask", "run", "--host", "0.0.0.0"] |
45 changes: 45 additions & 0 deletions
45
docs/docs/04_docker_intro/02_run_docker_container/end/app.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from flask import Flask, request | ||
|
||
app = Flask(__name__) | ||
|
||
stores = [{"name": "My Store", "items": [{"name": "Chair", "price": 15.99}]}] | ||
|
||
|
||
@app.get("/store") | ||
def get_stores(): | ||
return {"stores": stores} | ||
|
||
|
||
@app.post("/store") | ||
def create_store(): | ||
request_data = request.get_json() | ||
new_store = {"name": request_data["name"], "items": []} | ||
stores.append(new_store) | ||
return new_store, 201 | ||
|
||
|
||
@app.post("/store/<string:name>/item") | ||
def create_item(name): | ||
request_data = request.get_json() | ||
for store in stores: | ||
if store["name"] == name: | ||
new_item = {"name": request_data["name"], "price": request_data["price"]} | ||
store["items"].append(new_item) | ||
return new_item, 201 | ||
return {"message": "Store not found"}, 404 | ||
|
||
|
||
@app.get("/store/<string:name>") | ||
def get_store(name): | ||
for store in stores: | ||
if store["name"] == name: | ||
return store | ||
return {"message": "Store not found"}, 404 | ||
|
||
|
||
@app.get("/store/<string:name>/item") | ||
def get_item_in_store(name): | ||
for store in stores: | ||
if store["name"] == name: | ||
return {"items": store["items"]} | ||
return {"message": "Store not found"}, 404 |
Oops, something went wrong.