Add index page
This commit is contained in:
parent
94a278dbd4
commit
005c1ab659
2 changed files with 25 additions and 1 deletions
6
main.py
6
main.py
|
@ -1,4 +1,4 @@
|
||||||
from flask import Flask, request, make_response
|
from flask import Flask, request, make_response, render_template
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from flask_sock import Sock
|
from flask_sock import Sock
|
||||||
from glob import glob
|
from glob import glob
|
||||||
|
@ -129,6 +129,10 @@ def websocket(ws):
|
||||||
if operation == "usernames": # TODO
|
if operation == "usernames": # TODO
|
||||||
ws.send(json.dumps({"1": "Mathias"}))
|
ws.send(json.dumps({"1": "Mathias"}))
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
def index():
|
||||||
|
return render_template("index.html")
|
||||||
|
|
||||||
@app.route("/user/info", methods=["POST", "OPTIONS"])
|
@app.route("/user/info", methods=["POST", "OPTIONS"])
|
||||||
def user_info():
|
def user_info():
|
||||||
if request.method == "OPTIONS": return make_resp()
|
if request.method == "OPTIONS": return make_resp()
|
||||||
|
|
20
templates/index.html
Normal file
20
templates/index.html
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Obsidian Sync server</title>
|
||||||
|
<link rel="icon" href="https://obsidian.md/favicon.ico" sizes="32x32">
|
||||||
|
<link rel="icon" href="https://obsidian.md/favicon.svg" sizes="any" type="image/svg+xml">
|
||||||
|
<link rel="apple-touch-icon" href="https://obsidian.md/apple-touch-icon.png">
|
||||||
|
<style>
|
||||||
|
body {width: 35em;margin: 0 auto;font-family: Tahoma, Verdana, Arial, sans-serif;}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- Copy of nginx homepage -->
|
||||||
|
<h1>Obsidian Sync server</h1>
|
||||||
|
<p>If you see this page, your Obsidian Sync server server is successfully installed and working.</p>
|
||||||
|
<p>Available at <a href="https://git.hackclub.app/mathias/obsidian_freesync">mathias/obsidian_freesync</a></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue