mirror of
https://github.com/lucaspalomodevelop/Party.git
synced 2026-03-20 02:56:10 +00:00
basic html
This commit is contained in:
parent
9cf7bb6dbc
commit
90e3979d2a
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
4
party/static/css/style.css
Normal file
4
party/static/css/style.css
Normal file
@ -0,0 +1,4 @@
|
||||
body {
|
||||
background-color: black;
|
||||
color: white;
|
||||
}
|
||||
11
party/templates/index.html
Normal file
11
party/templates/index.html
Normal 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>
|
||||
@ -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")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user