title: I get a 404 error on Heroku but it works locally
body: <p>My app works locally (when running Heroku local in the terminal), with the correct routes. However when I move onto the Heroku server the app is built fine but then just shows a 404 error when I go onto the app. The Heroku.logs return something like this for whichever page I go onto.</p>
  <pre><code>2020-07-16T17:24:44.233685+00:00 heroku[router]: at=info method=GET path=&quot;/&quot; host=advancedmatchedbetting.herokuapp.com request_id=315ee036-cb58-4493-9b46-c2a25337070e fwd=&quot;176.250.1.224&quot; dyno=web.1 connect=1ms service=3ms status=404 bytes=400 protocol=https
  </code></pre>
  <p>I will as little code as I think is needed here to keep it succinct, if there's any more that would be useful to you then let me know and ill put it up also. The git commit/push/add are all upto date.</p>
  <p>Procfile</p>
  <pre><code>web: cd api &amp;&amp; export APP_SETTINGS=config.cfg &amp;&amp; gunicorn wsgi:app --log-file -
  </code></pre>
  <p>wsgi.py</p>
  <pre><code>from application.__init__ import create_app
  
  app = create_app()
  
  if __name__ == &quot;__main__&quot;:
      app.run()
  </code></pre>
  <p><strong>init</strong>.py</p>
  <pre><code>db = SQLAlchemy()
  
  def create_app():
      app = Flask(__name__, static_folder='/Users/ianholdroyd/Documents/GitHub/advancedmatchedbetting_react/build', static_url_path='/')
      db.init_app(app)
      app.config.from_envvar('APP_SETTINGS')
      with app.app_context():
          from . import routes
          db.create_all()
          return app
  </code></pre>
  <p>routes.py</p>
  <pre><code>@app.route('/')
  def index():
      return app.send_static_file('index.html')
  
  @app.route('/api/signup', methods=['POST'])
  def signup():
      data = request.get_json()
      new_user = newsletter(
              first_name=data['firstName'],
              last_name=data['lastName'],
              email= data['email'],
              created=dt.now()
          )
      db.session.add(new_user)  # Adds new User record to database
      db.session.commit()
      return(&quot;&quot;)
  </code></pre>
  <p>config.cfg</p>
  <pre><code>SECRET_KEY = ****
  SQLALCHEMY_TRACK_MODIFICATIONS = False
  DEBUG = True
  SQLALCHEMY_DATABASE_URI = 'sqlite:///static/site.db'
  </code></pre>
  <p>app.js</p>
  <pre><code>function App() {
  
      return (
        &lt;Router&gt;
          &lt;Switch&gt;
            &lt;Route exact path=&quot;/&quot; component={homepage} /&gt;
            &lt;Route exact path = &quot;/404&quot; component={NotFoundPage} /&gt;
            &lt;Route exact path=&quot;/calculator/&quot; component={Calculator} /&gt;
            &lt;Route exact path=&quot;/blogpost/:id&quot; component={blogpostpage} /&gt;
            &lt;Route exact path=&quot;/signup&quot; component={signuppage} /&gt;
            &lt;Redirect to=&quot;/404&quot;/&gt; 
          &lt;/Switch&gt;
          &lt;/Router&gt;
        );
      }
  
  
  export default App;
  </code></pre>