IbraheemAlquraishy's picture
fixing cors error
b8194fe
raw
history blame contribute delete
437 Bytes
from flask import Flask,request
from flask_cors import CORS
from pass_str import *
app=Flask(__name__)
CORS(app)
m,td=load()
@app.post("/check")
def check():
request.get_json()
i=request.json.get('password')
out=test(i,m,td)
j=str(out)
j=j.replace("['","")
j=j.replace("']","")
if j=="meduim":
j="medium"
return '{"level":"'+j+'"}'
if __name__=="__main__":
app.run(debug=True)