mirror of
https://github.com/kaiyuran/Emoji-translator-Server.git
synced 2024-11-22 09:03:39 +00:00
add cors
This commit is contained in:
parent
7205969808
commit
0d02124115
1 changed files with 3 additions and 1 deletions
4
app.py
4
app.py
|
@ -1,4 +1,5 @@
|
||||||
from flask import Flask, request, jsonify
|
from flask import Flask, request, jsonify
|
||||||
|
from flask_cors import CORS
|
||||||
import random
|
import random
|
||||||
|
|
||||||
def emojify(message):
|
def emojify(message):
|
||||||
|
@ -204,9 +205,10 @@ def emojify(message):
|
||||||
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
CORS(app)
|
||||||
|
|
||||||
@app.route('/getemoji', methods=['GET'])
|
@app.route('/getemoji', methods=['GET'])
|
||||||
|
# @cross_origin()
|
||||||
def get_random_emoji():
|
def get_random_emoji():
|
||||||
# Get the 'letter' parameter from the URL
|
# Get the 'letter' parameter from the URL
|
||||||
message = request.args.get('message')
|
message = request.args.get('message')
|
||||||
|
|
Loading…
Reference in a new issue