Compare commits
No commits in common. "4c76eb3f1b15b74363f5057464dafacadc4aac1c" and "e5749f008e6cf091e7a4e02c5ca55bb173e9031d" have entirely different histories.
4c76eb3f1b
...
e5749f008e
2 changed files with 5 additions and 39 deletions
37
README.md
37
README.md
|
@ -1,37 +0,0 @@
|
|||
# Installation
|
||||
|
||||
|
||||
## Setting up the environment
|
||||
|
||||
1. Create a virtual environment:
|
||||
```bash
|
||||
python3 -m venv .venv
|
||||
```
|
||||
|
||||
2. Activate the virtual environment:
|
||||
```bash
|
||||
. .venv/bin/activate
|
||||
```
|
||||
|
||||
3. Install dependencies:
|
||||
```bash
|
||||
pip install requirements.txt
|
||||
```
|
||||
|
||||
```systemd
|
||||
# /etc/systemd/system/adrianux.service
|
||||
[Unit]
|
||||
Description=WSGI app
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=adrianux
|
||||
WorkingDirectory=/opt/Adrianux.net
|
||||
ExecStart=/opt/Adrianux.net/.venv/bin/waitress-serve --listen=127.0.0.1:8080 app:app
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
7
app.py
7
app.py
|
@ -3,7 +3,7 @@ from flask import Flask, render_template, redirect, url_for
|
|||
import requests
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
navigation = {"Imprint":"imprint"}
|
||||
@app.route("/imprint")
|
||||
def root():
|
||||
return render_template("imprint.html")
|
||||
|
@ -29,11 +29,14 @@ def get_status_code(link):
|
|||
def get_status(link):
|
||||
match get_status_code(link):
|
||||
case 200:
|
||||
print(200)
|
||||
return "ONLINE"
|
||||
case 500:
|
||||
print(500)
|
||||
return "ERROR"
|
||||
case _:
|
||||
print("OTHER")
|
||||
return "OFFLINE"
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=False)
|
||||
app.run(debug=True)
|
||||
|
|
Loading…
Reference in a new issue