Skip to content

Commit

Permalink
Chore: Remove old non-react frontend logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AuxiliumCDNG committed Feb 22, 2023
1 parent f44ab46 commit 78cacdb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions globals.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from flask import Flask
from flask import Flask, Blueprint

from statics import config

app = Flask("BulletFlask", static_folder='public')
app = Flask("BulletFlask", template_folder="web/build/", static_folder='./web/build', static_url_path='/')
app.config['TEMPLATES_AUTO_RELOAD'] = True
app.secret_key = config.secret_key


cut_objects = {}
9 changes: 9 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import flask
from flask import render_template, request

from globals import app
from helpers import init
from routes import user
Expand All @@ -19,6 +22,12 @@
app.register_blueprint(api_moderate)
app.register_blueprint(api_interact)

@app.errorhandler(404)
def react(*args, **kwargs):
if request.path.startswith("/api/"):
return "Endpoint not found", 404
return app.send_static_file("index.html")

@app.after_request
def add_header(r):
"""
Expand Down

0 comments on commit 78cacdb

Please sign in to comment.