Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Enable cross origin
Browse files Browse the repository at this point in the history
  • Loading branch information
cenrak committed Jul 1, 2017
1 parent 86f89cf commit 3e21e2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.py
@@ -1,8 +1,11 @@
from flask import Flask, render_template, request, json
from flask_cors import CORS, cross_origin

import requests, bs4, os

app = Flask(__name__)

cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
"""
route('/') renders index.html, which shows nothing but how to use this app
"""
Expand All @@ -20,6 +23,7 @@ def hello():
send a json with an error message to check the URL or with the status code.
"""
@app.route("/get_title", methods=['GET'])
@cross_origin()
def get():
if request.args.get('url') is None:
return render_template('index.html')
Expand Down

0 comments on commit 3e21e2f

Please sign in to comment.