Created
July 29, 2015 05:16
-
-
Save bitcraft/cab1f2e570aa864daa12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from glob import glob | |
from flask import Flask, jsonify | |
app = Flask(__name__) | |
scan_dir = 'c:\\*' | |
@app.route('/files') | |
def get_files(): | |
files = {'files': list(glob(scan_dir))} | |
return jsonify(files) | |
@app.route('/print/<filename>') | |
def print_file(filename): | |
print(filename) | |
return 'ok' | |
if __name__ == '__main__': | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment