fork download
  1. from flask import Flask, request, jsonify
  2. # import utils
  3. # from flask_cors import CORS, cross_origin
  4. app = Flask(__name__)
  5.  
  6. # cors = CORS(app)
  7. # app.config['CORS_HEADERS'] = 'Content-Type'
  8. # app.config['CORS_ORIGINS'] = ['http://localhost:3000']
  9. # app.config['Access-Control-Allow-Origin'] = '*'
  10.  
  11. @app.route('/')
  12. # @cross_origin()
  13. def hello():
  14. return "Hello World"
  15.  
  16. @app.route('/predict', methods=['POST'])
  17. # @cross_origin()
  18. def predict():
  19. print("request received")
  20. # news = request.json.get('news')
  21. print(news)
  22. # response = jsonify(utils.manual_testing(news))
  23. # print(response)
  24. # return response
  25.  
  26.  
  27. if __name__ == 'main':
  28. print("Starting Python Flask Server For News detection")
  29. app.run(port=5500)
Success #stdin #stdout 0.11s 21036KB
stdin
Standard input is empty
stdout
Standard output is empty