From ddad26212e7d54af60342d8387d52476e875cf2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1tia=20Nakamura?= Date: Mon, 12 Jun 2023 18:06:19 +0200 Subject: [PATCH] Import project --- README.md | 3 +++ app.py | 9 +++++++++ requirements.txt | 8 ++++++++ templates/hello.html | 7 +++++++ 4 files changed, 27 insertions(+) create mode 100644 README.md create mode 100644 app.py create mode 100644 requirements.txt create mode 100644 templates/hello.html diff --git a/README.md b/README.md new file mode 100644 index 0000000..e96ccdb --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +## HelloFlask! + +This is an example project demonstrating how to deploy a Flask app to Fly.io. \ No newline at end of file diff --git a/app.py b/app.py new file mode 100644 index 0000000..69b4e83 --- /dev/null +++ b/app.py @@ -0,0 +1,9 @@ +from flask import Flask, render_template + +app = Flask(__name__) + + +@app.route('/') +@app.route('/') +def hello(name=None): + return render_template('hello.html', name=name) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..63d80a5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +blinker==1.6.2 +click==8.1.3 +Flask==2.3.2 +gunicorn==20.1.0 +itsdangerous==2.1.2 +Jinja2==3.1.2 +MarkupSafe==2.1.2 +Werkzeug==2.3.3 diff --git a/templates/hello.html b/templates/hello.html new file mode 100644 index 0000000..9efccf0 --- /dev/null +++ b/templates/hello.html @@ -0,0 +1,7 @@ + +Hello from Fly.io +{% if name %} +

Hello, {{ name | capitalize }}!

+{% else %} +

Hello, World!

+{% endif %} \ No newline at end of file