forked from Jrohy/multi-v2ray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
web.py
25 lines (19 loc) · 594 Bytes
/
web.py
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from flask import Flask, request, jsonify, render_template
from flask_httpauth import HTTPBasicAuth
from app import func_router
from config import Config
config = Config()
app = Flask(__name__, static_url_path='/static')
app.register_blueprint(func_router)
auth = HTTPBasicAuth()
@auth.get_password
def get_pw(username):
return config.get_web('pass')
@app.route('/')
@auth.login_required
def index():
return render_template(config.get_web('index_page'))
if __name__ == '__main__':
app.run(debug=True, port=config.get_web('port'))