Move to PI
This commit is contained in:
commit
a3c1de7411
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
venv
|
BIN
__pycache__/main.cpython-312.pyc
Normal file
BIN
__pycache__/main.cpython-312.pyc
Normal file
Binary file not shown.
22
main.py
Normal file
22
main.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import re
|
||||||
|
import json
|
||||||
|
|
||||||
|
from flask import Flask, request
|
||||||
|
import xmltodict
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route('/')
|
||||||
|
def hello_world():
|
||||||
|
return "Alive!"
|
||||||
|
|
||||||
|
@app.route('/pnp/HELLO')
|
||||||
|
def pnp_hello():
|
||||||
|
return "", 200
|
||||||
|
|
||||||
|
@app.route('/pnp/WORK-REQUEST', methods=['POST'])
|
||||||
|
def pnp_work_request():
|
||||||
|
src_ip = request.environ.get('HTTP_X_REAL_IP', request.remote_addr)
|
||||||
|
data = xmltodict.parse(request.data)
|
||||||
|
print(json.dumps(data, indent=2))
|
||||||
|
|
0
requirements.txt
Normal file
0
requirements.txt
Normal file
3
start_app.sh
Executable file
3
start_app.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
gunicorn -w 4 "main:app" -b 0.0.0.0:80 --reload --access-logfile -
|
Loading…
Reference in New Issue
Block a user