title: In Flask, is there a way to hide a @app.route from everyone but the app itself. My database can be seen from a url in JSON format
body: <p>So I am working on a FLASK server, using sqlite3, json, axios and VUEJS. My VueJS frontend calls my sqlite3 database using axios. On the flask side the database is sent with jsonify over @app.route('/api/getdatabase', methods=['GET']). If I plug that url in the browser while my flask server is running I can see the entire database in JSON format from <a href="http://localhost:5000/api/getdatabase" rel="nofollow noreferrer">http://localhost:5000/api/getdatabase</a>.</p>
  
  <p>Is there a way to stop access to that url route from the browser while keeping that 'GET' connection to axios alive?</p>
  
  <p>I attached the Flask @app.route and just in case the VueJs method that is calling 'GET' on that Flask route.</p>
  
  <pre><code>@app.route('/api/getdatabase', methods=['GET'])
  def database_get():
          if request.method == 'GET':
                  print("/getdatabase record")
                  conn = sql.connect('test.sqlite3')
                  cursor = conn.cursor()
                  cursor.execute("SELECT * FROM DATABASE ORDER By id")
                  rows = cursor.fetchall()
                  return jsonify(rows)
  </code></pre>
  
  <pre><code>    getDatabase() {
        const path = "http://192.168.1.71:5000/api/getdatabase";
        axios
          .get(path)
          .then(response =&gt; {
            // console.log(res.data)
            this.database = response.data;
          })
          .catch(error =&gt; {
            console.log("Failed to get database");
          });
      },
  </code></pre>