This little service is supposed to help learn coding in Python3. The idea is to serve cooking recipes to a web consumer.
The expected result is:
-
Implement a recipe service in Python3, based on the template in this repository.
-
Start the application.
-
Open browser, hit in the service URL (see below), and see the recipes at the webpage.
Before downloading and starting the application, make sure your python3 environment is already installed and ready to use.
git clone https://github.com/m8nky/recipelist.git
And try to run it the first time.
cd recipelist/app
./run
When the server is running, open the browser and load the website http://localhost:8001/
.
The browser should display 'Hello World!'.
Edit the file app/msapp/domain/service/recipeService.py
and implement the serve
function.
class RecipeService:
'''
RecipeService.serve is called by the HTTP server, when a new browser request comes in.
Serve the browser with some recipe content.
Parameters:
request (str): The path of the requested URL (e.g. '/' or '/recipelist').
Returns:
str: The content (text or html), that is replied to the browser.
'''
def serve(self, request: str) -> str:
# ADD YOUR CODE HERE!!!
pass