cosmicpi-rpi_V1.5/bin/cosmicpi-ui

25 lines
547 B
Text
Raw Normal View History

2018-03-24 23:27:19 +00:00
#!/usr/bin/env python
from flask import send_from_directory
from cosmicpi.rest.app import create_app
import cosmicpi.ui
import os
path = os.path.abspath(cosmicpi.ui.__file__)
UI_DIR = os.path.dirname(path)
if __name__ == '__main__':
app = create_app()
@app.route('/dist/<path:path>')
def serve_page(path):
return send_from_directory(os.path.join(UI_DIR, 'dist'), path)
@app.route('/')
def server_index():
return send_from_directory(UI_DIR, 'index.html')
2018-04-22 17:06:55 +00:00
app.run(debug=True, host='0.0.0.0', port=80)