Skip to content

Instantly share code, notes, and snippets.

@dineshsonachalam
Created October 29, 2021 11:33
Show Gist options
  • Save dineshsonachalam/fc83505ff6407329b5819f9fe9d00309 to your computer and use it in GitHub Desktop.
Save dineshsonachalam/fc83505ff6407329b5819f9fe9d00309 to your computer and use it in GitHub Desktop.
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