Last active
July 14, 2016 16:08
-
-
Save kaidokert/30e85c511d569d2f3bc23c0cdb2096b6 to your computer and use it in GitHub Desktop.
Low fuss bottle app to serve static
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
import os | |
import sys | |
import bottle | |
bottle.debug(True) | |
static_root = os.path.abspath(os.path.dirname(__file__)) | |
@bottle.route('/') | |
@bottle.route('/<filename>') | |
def server_static(filename='index.html'): | |
return bottle.static_file(filename, root=static_root) | |
bottle.run(host='0.0.0.0', port=sys.argv[1] if len(sys.argv) > 1 else 5000, | |
reloader=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment