Allows CORS
This commit is contained in:
parent
d2b70dacd8
commit
1f0a05ca9d
|
@ -22,7 +22,7 @@ Source code for [Questable Bot](https://t.me/questable_bot) and the relevant
|
||||||
## Questable API Server
|
## Questable API Server
|
||||||
|
|
||||||
+ Install the dependencies
|
+ Install the dependencies
|
||||||
+ `pip3 install Flask`
|
+ `pip3 install Flask flask_cors`
|
||||||
+ Install `gunicorn`
|
+ Install `gunicorn`
|
||||||
+ `pip3 install gunicorn`
|
+ `pip3 install gunicorn`
|
||||||
+ Run `gunicorn3 -b 127.0.0.1:5000 server:app`. Change port if you want to run
|
+ Run `gunicorn3 -b 127.0.0.1:5000 server:app`. Change port if you want to run
|
||||||
|
|
|
@ -4,8 +4,10 @@ import questable
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import errors
|
import errors
|
||||||
from flask import Flask, jsonify, request, redirect
|
from flask import Flask, jsonify, request, redirect
|
||||||
|
from flask_cors import CORS
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
CORS(app)
|
||||||
db = sqlite3.connect("questable.db", check_same_thread=False)
|
db = sqlite3.connect("questable.db", check_same_thread=False)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue