Skip to content

Instantly share code, notes, and snippets.

@arindampradhan
Created September 7, 2016 14:09
Show Gist options
  • Save arindampradhan/aef39280d28f24136a4c8f12582db794 to your computer and use it in GitHub Desktop.
Save arindampradhan/aef39280d28f24136a4c8f12582db794 to your computer and use it in GitHub Desktop.

Revisions

  1. arindampradhan created this gist Sep 7, 2016.
    20 changes: 20 additions & 0 deletions live.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    from flask import Flask, send_from_directory
    from livereload import Server

    app = Flask(__name__, static_url_path='/', static_folder='Views')


    @app.route('/bower_components/<path:path>')
    def send_assets(path):
    return send_from_directory('bower_components', path)


    @app.route('/')
    def index():
    return app.send_static_file('index.html')

    if __name__ == '__main__':
    server = Server(app.wsgi_app)
    server.serve()
    server.watch('/Views/*')
    app.run(debug=True)