From 026913013a903d950fcb28dc830c8e7ff7001227 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 7 Mar 2021 19:16:35 -0700 Subject: [PATCH] Install Flask and serve index.html --- client/build/index.html | 1 + server/main.py | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 client/build/index.html diff --git a/client/build/index.html b/client/build/index.html new file mode 100644 index 0000000..3b18e51 --- /dev/null +++ b/client/build/index.html @@ -0,0 +1 @@ +hello world diff --git a/server/main.py b/server/main.py index 3baf8a9..aabbdd4 100644 --- a/server/main.py +++ b/server/main.py @@ -1,3 +1,12 @@ -import socket -import sys -import time +from flask import Flask +from flask_cors import CORS + +build_folder = '../client/build' +app = Flask(__name__, static_folder=build_folder, static_url_path='') +CORS(app) + +@app.route('/') +def index(): + return app.send_static_file('index.html') + +app.run()