rename files -> file_list
This commit is contained in:
@@ -68,7 +68,7 @@ class PathHandle:
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
payload = {"path": "/".join(path)}
|
payload = {"path": "/".join(path)}
|
||||||
r = requests.get(PathHandle.request_url("files"), params=payload, auth=("bam", "bam"))
|
r = requests.get(PathHandle.request_url("file_list"), params=payload, auth=("bam", "bam"))
|
||||||
print(r.text)
|
print(r.text)
|
||||||
return r.json()
|
return r.json()
|
||||||
|
|
||||||
|
@@ -109,10 +109,10 @@ class FileAPI(Resource):
|
|||||||
super(FileAPI, self).__init__()
|
super(FileAPI, self).__init__()
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
filepath = os.path.join(app.config['STORAGE_PATH'], request.args['filepath'])
|
filepath = os.path.join(app.config['STORAGE_PATH'], request.args['filepath'])
|
||||||
f = open(filepath, 'rb')
|
f = open(filepath, 'rb')
|
||||||
return Response(f, direct_passthrough=True)
|
return Response(f, direct_passthrough=True)
|
||||||
|
|
||||||
|
|
||||||
api.add_resource(FilesListAPI, '/files', endpoint='files')
|
api.add_resource(FilesListAPI, '/file_list', endpoint='file_list')
|
||||||
api.add_resource(FileAPI, '/file', endpoint='file')
|
api.add_resource(FileAPI, '/file', endpoint='file')
|
||||||
|
Reference in New Issue
Block a user