feat: properly export env vars for cnb apps
They are not baked into the image like they are for herokuish, so we need to manually set them via --env. Additionally, due to newline constraints in docker, we need to use `--env=key` format to correctly pull the values into place.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import http.server
|
||||
import json
|
||||
import os
|
||||
|
||||
|
||||
@@ -7,7 +8,12 @@ class GetHandler(http.server.BaseHTTPRequestHandler):
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", "text/plain; charset=utf-8")
|
||||
self.end_headers()
|
||||
self.wfile.write("python/http.server".encode("utf-8"))
|
||||
|
||||
if self.path == '/':
|
||||
self.wfile.write("python/http.server".encode("utf-8"))
|
||||
else:
|
||||
data = json.dumps(dict(os.environ), sort_keys=True, indent=4)
|
||||
self.wfile.write(data.encode("utf-8"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user