First Code Commit

This commit is contained in:
Lucas Mathews
2024-05-17 10:48:19 +02:00
parent eeb1468453
commit 745ed14c56
39 changed files with 2227 additions and 0 deletions

8
Flask App/ARG/agent.py Normal file
View File

@@ -0,0 +1,8 @@
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--x', type=int, required=True)
parser.add_argument('--y', type=int, required=True)
args = parser.parse_args()
product = args.x * args.y
print(f"{args.x} * {args.y} = {product}")

19
Flask App/app.py Normal file
View File

@@ -0,0 +1,19 @@
from flask import Flask, render_template, request
import requests
SERVER_URL = "http://127.0.0.1:8000"
app = Flask(__name__)
@app.route("/", methods=["GET"])
def loginGET():
return render_template("login.html")
@app.route("/", methods=["POST"])
def loginPOST():
username = request.form["username"]
password = request.form["password"]
response = requests.get( f"{SERVER_URL}/login?username={username}&password={password}")
return render_template("succes.html", data = response.content)
app.run()

0
Flask App/main.py Normal file
View File

View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
</head>
<body>
<form method="post">
<label>Username:</label>
<input type="text" name="username">
<label>Password:</label>
<input type="password" name="password">
<input type="submit" value="Login">
</form>
</body>
</html>

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>Document</title>
</head>
<body>
<p>{{data}}</p>
</body>
</html>