basic html

This commit is contained in:
hyperbel 2023-07-05 03:55:20 +02:00
parent 9cf7bb6dbc
commit 90e3979d2a
5 changed files with 26 additions and 6 deletions

View File

@ -2,6 +2,3 @@ import party.main as main
def create_app():
return main.app
if __name__ == '__main__':
create_app().run(debug=True, host='localhost', port=5000) #pragma: no cover

View File

@ -1,12 +1,14 @@
from flask import Flask, jsonify
from flask import Flask, jsonify, render_template
app = Flask(__name__)
app = Flask(__name__,
template_folder='templates',
static_folder='static',)
@app.route('/', methods=['GET'])
def index():
response = jsonify(success=True)
response.status_code = 200
return response
return render_template('index.html')
@app.route('/api', methods=['GET'])
def api():
@ -79,3 +81,6 @@ def api_music_add_song():
response = jsonify(success=True)
response.status_code = 200
return response
if __name__ == '__main__':
app.run(debug=True, host='localhost', port=5000) #pragma: no cover

View File

@ -0,0 +1,4 @@
body {
background-color: black;
color: white;
}

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Party Controller</title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
</body>
<h1>Party Controller</h1>
</html>

View File

@ -4,6 +4,9 @@ class TestServer:
def test_root(self, client):
response = client.get("/")
assert response.status_code == 200
assert b"<title>Party Controller</title>" in response.data
assert b"<h1>Party Controller</h1>" in response.data
def test_api(self, client):
response = client.get("/api")