Skip to content
Snippets Groups Projects
Commit f6cbfcff authored by Wortman, Elliot (UG - Comp Sci & Elec Eng)'s avatar Wortman, Elliot (UG - Comp Sci & Elec Eng)
Browse files

Flask backend return index.html & values endpoint

Specified custom static & template folder for compatibility with `npm run build`
parent 617e7d1d
No related branches found
No related tags found
2 merge requests!5Replace Vue3 template site with NanoPatch UI & API,!1Flask REST API Backend
...@@ -26,3 +26,5 @@ coverage ...@@ -26,3 +26,5 @@ coverage
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?
__pycache__/
app.py 0 → 100644
from flask import Flask, jsonify, render_template
from flask_cors import CORS
app = Flask(__name__, static_folder="./dist/assets", template_folder="./dist")
CORS(app)
@app.route("/")
def main():
return render_template("index.html")
@app.route("/values")
def values():
values = [{"N": 10}, {"P": 11}, {"K": 12}, {"T": 5}, {"H": 6}, {"M": 7}]
return jsonify(values)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment