This repository has been archived on 2023-06-18. You can view files and clone it, but cannot push or open issues or pull requests.
va-project/stockingly.py

24 lines
569 B
Python
Raw Normal View History

2023-05-03 08:54:36 +00:00
from flask import Flask, jsonify, redirect, url_for, send_from_directory
2023-05-03 08:07:34 +00:00
from flask_cors import CORS
2023-05-03 08:54:36 +00:00
from backend.utils.build_frontend import build_frontend
import os
import subprocess
2023-05-03 08:07:34 +00:00
# instantiate the app
app = Flask(__name__, static_url_path='/static', static_folder='stockingly-frontend/dist')
app.config.from_object(__name__)
# enable CORS
CORS(app, resources={r'/*': {'origins': '*'}})
2023-05-03 08:54:36 +00:00
@app.route('/', methods=['GET'])
def index():
return redirect(url_for('static', filename='index.html'))
2023-05-03 08:07:34 +00:00
if __name__ == '__main__':
2023-05-03 08:54:36 +00:00
build_frontend()
app.run()