repl.it
@Scoder12/

reverse proxy kinda

Python

No description

fork
loading
Files
  • main.py
  • test.xml
  • Packager files
  • poetry.lock
  • pyproject.toml
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import flask
app = flask.Flask('app')

route_data = {}

@app.route('/add')
def add_route():
    route = flask.request.args.get("r")
    data = flask.request.args.get("d")
    if route is None or not data:
        return "Missing r or d query params", 400
    route_data[route or ""] = data
    return "Success"

@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def hello_world(path):
    print(repr(path))
    return route_data.get(path) or "Nothing yet"


app.run(host='0.0.0.0', port=8080)
Fetching token
?