I am trying to call a server-side script that is located in a file right off the root directory of my website. I can get to my javascript file fine, and I get to a point in the script where I call:
var posting = $.post('/featurize', $('#input'))
this is my python script (called script.py):
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route('/featurize', methods=['POST'])
def featurize():
--code here, getting output--
return jsonify({'output': output});
if __name__ == '__main__':
app.run()
However, I'm returned a posting.fail each time I call it, and when I debug in my browser console, I get this: http://mywebsite.com/featurize 404 (Not Found)
Therefore, my @app.route('/featurize') must not be working for some reason. Any help would be appreciated. Thank you!
(I'm also using jquery 1.11.1 from Google)