mirror of
https://github.com/lucky-sideburn/kubeinvaders.git
synced 2026-08-29 00:47:16 +00:00
add python
This commit is contained in:
@@ -9,11 +9,24 @@ else
|
||||
k8s_url = os.getenv("ENDPOINT")
|
||||
end
|
||||
|
||||
ngx.header['Access-Control-Allow-Origin'] = '*'
|
||||
ngx.header['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS'
|
||||
ngx.header['Access-Control-Allow-Headers'] = 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'
|
||||
ngx.header['Access-Control-Expose-Headers'] = 'Content-Length,Content-Range';
|
||||
ngx.req.read_body()
|
||||
|
||||
local token = os.getenv("TOKEN")
|
||||
local arg = ngx.req.get_uri_args()
|
||||
local body_data = ngx.req.get_body_data()
|
||||
|
||||
ngx.log(ngx.ERR, "[programming_mode]" .. body_data)
|
||||
|
||||
file = io.open("/tmp/experiments.yaml", "w")
|
||||
io.output(file)
|
||||
io.write(body_data)
|
||||
io.close(file)
|
||||
|
||||
local handle = io.popen("python3 /opt/programming_mode/start.py")
|
||||
local result = handle:read("*a")
|
||||
|
||||
ngx.say("Chaos program has been started...")
|
||||
|
||||
Reference in New Issue
Block a user