Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,10 @@
|
|
1 |
-
import
|
2 |
-
import webbrowser
|
3 |
|
4 |
-
|
5 |
-
webbrowser.open('https://dongsiqie.me')
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
return
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
fn=redirect,
|
14 |
-
inputs=[],
|
15 |
-
outputs=[],
|
16 |
-
title="自动重定向",
|
17 |
-
description="打开这个服务将会自动重定向到 https://dongsiqie.me"
|
18 |
-
)
|
19 |
-
|
20 |
-
iface.launch()
|
|
|
1 |
+
from flask import Flask, redirect
|
|
|
2 |
|
3 |
+
app = Flask(__name__)
|
|
|
4 |
|
5 |
+
@app.route('/')
|
6 |
+
def index():
|
7 |
+
return redirect('https://dongsiqie.me', code=302)
|
8 |
|
9 |
+
if __name__ == '__main__':
|
10 |
+
app.run()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|