Created
October 29, 2021 11:33
-
-
Save dineshsonachalam/fc83505ff6407329b5819f9fe9d00309 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import Response | |
import requests | |
app = Flask(__name__, static_url_path='/change_this_to_somthing_else_that_is_not_static') | |
basePath = 'https://create-react-app-example.vercel.app' | |
# basePath = 'https://www.intercom.com' | |
@app.route("/") | |
def serve_react_page(): | |
return requests.get(basePath).text | |
@app.route('/<path:subpath>') | |
def projects(subpath): | |
r = requests.get(basePath + '/' + subpath) | |
return Response(r.text, mimetype=r.headers['Content-Type']) | |
if __name__ == '__main__': | |
app.run(host='0.0.0.0', port=5000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment