This commit is contained in:
dj
2026-11-05 20:35:16 +00:00
commit 21a850a9d4
9 changed files with 52 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
# Sample Flask Web App
This is a simple Flask application.
+10
View File
@@ -0,0 +1,10 @@
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80)
+1
View File
@@ -0,0 +1 @@
Flask
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
pip3 install -r /var/www/html/sample-web-app/requirements.txt
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
sudo yum update -y
sudo yum install -y python3 python3-pip
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
cd /var/www/html/sample-web-app
sudo python3 app.py > app.log 2>&1 &
+8
View File
@@ -0,0 +1,8 @@
from setuptools import setup, find_packages
setup(
name='sample-web-app',
version='1.0',
packages=find_packages(),
install_requires=['Flask'],
)
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flask App</title>
</head>
<body>
<h1>Welcome to Flask!</h1>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
import unittest
from app import app
class FlaskTestCase(unittest.TestCase):
def test_home(self):
tester = app.test_client(self)
response = tester.get('/')
self.assertEqual(response.status_code, 200)
if __name__ == '__main__':
unittest.main()