Sa-m's picture
Create server.py
6f7e3eb
raw
history blame
716 Bytes
from flask import Flask,redirect,url_for
from flask import Flask, jsonify, render_template, request, stream_with_context, Response
from flask_cors import CORS
import requests
app = Flask(__name__)
CORS(app)
@app.route('/')
def welc():
return 'Main page '
# @app.route('/fail/<int:marks>')
# def fail(score):
# return 'failure'
# @app.route('/success/<int:marks>')
# def success(score):
# return 'success'
@app.route('/results/<int:marks>')
def results(marks):
if marks>36:
result='Passed'
else:
result='fail'
return f'{result} with {marks} marks'
# return redirect(url_for(result,score=marks))
if __name__ == "__main__":
app.run(host="0.0.0.0", port=7860)