This is the week 1 task done under Hasura Product Development Fellowship.
Python flask should be installed to run this code. Download python from https://www.python.org/downloads/ and install We are using python3 for this app. Flask the official site is http://flask.pocoo.org/docs/0.12/installation/
In cmd for windows and equivalent terminals:
Afer installing python and pip, navigate to the folder containing these files and install flask by "pip install flask"
- "set FLASK_APP=routes.py" then enter
Now to run the app
- "flask run"
-
Displaying simple hello world After running "flask run" in cmd open browser at http://127.0.0.1:5000/ and output will be displayed.
-
Responding with authors and number of posts with objects acquired from different urls. Open http://127.0.0.1:5000/authors and output will be displayed.
-
Set a simple cookie (if it has not already been set) Open http://127.0.0.1:5000/setcookie and cookies will be set.
-
Fetch the set cookie with http://localhost:8080/getcookies and display the stored key-values in it. Open http://127.0.0.1:5000/getcookies and set cookies will be displayed.
-
Denying requests to http://localhost:8080/robots.txt page.
When u try to access the url see what happens.:)
-
Render an HTML and image.
Open browser at http://127.0.0.1:5000/html and a sample html is rendered.
Open http://127.0.0.1:5000/image and an image will be rendered. It is a Pikachu.
-
User input display Open http://127.0.0.1:5000/input in browser Enter and value in the input box Then the data will be visible on your cmd or any terminal.
- Albin Pius - Initial work - albin21stcentury