-
Notifications
You must be signed in to change notification settings - Fork 1
/
man.py
36 lines (23 loc) · 819 Bytes
/
man.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
26
27
28
29
30
31
32
33
34
35
36
# Created by wushuyi on 2016/8/5 0005.
from flask import Flask, request, jsonify, \
send_from_directory, send_file
from flask_cors import CORS
from viewer import FileManagerView
app = Flask(__name__)
CORS(app)
@app.route('/')
def hello_world():
return send_file('./index.html')
# app.add_url_rule
@app.route('/manager/<path:path>')
def send_manager(path):
return send_from_directory('./Filemanager-2.4.0', path)
@app.route('/tinymce_4.4.1/<path:path>')
def send_tinymce(path):
return send_from_directory('./tinymce_4.4.1', path)
@app.route('/userfiles/<path:path>')
def send_userfiles(path):
return send_from_directory('/home/wushuyi/userfiles', path)
app.add_url_rule('/filemanager', view_func=FileManagerView.as_view('manager'))
if __name__ == '__main__':
app.run(host='0.0.0.0')