repl.it
@21natzil/

flask-proxy

Python

Hello world in python flask

fork
loading
Files
  • main.py
  • Packager files
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from flask import Flask
from requests import get

app = Flask(__name__)
SITE_NAME = 'https://pythondiscord.com'

@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def proxy(path):
  return get(f'{SITE_NAME}{path}').content

if __name__ == '__main__':
  app.run(host='0.0.0.0', port=8080)