File size: 533 Bytes
4d8da3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
import subprocess
from flask import Flask

app = Flask(__name__)

# Start Webtop
subprocess.Popen(
    ["/init"],
    stdout=subprocess.DEVNULL,
    stderr=subprocess.DEVNULL
)

@app.route("/")
def home():
    return """

    <html>

    <head>

        <meta http-equiv="refresh" content="0; url=/">

    </head>

    <body>

        Desktop is starting...

    </body>

    </html>

    """

if __name__ == "__main__":
    port = int(os.environ.get("PORT", 7860))
    app.run(host="0.0.0.0", port=port)