v1.0.159: /static/app.js (nginx location / matches)
This commit is contained in:
@@ -40,7 +40,7 @@ class Handler(BaseHTTPRequestHandler):
|
|||||||
self._handle_process_v2(parsed)
|
self._handle_process_v2(parsed)
|
||||||
elif parsed.path == "/health":
|
elif parsed.path == "/health":
|
||||||
self._json({"ok": True, "db": DB_CONFIG["dbname"]})
|
self._json({"ok": True, "db": DB_CONFIG["dbname"]})
|
||||||
elif parsed.path == "/app.js":
|
elif parsed.path == "/app.js" or parsed.path.startswith("/static/"):
|
||||||
self._handle_app_js()
|
self._handle_app_js()
|
||||||
elif parsed.path == "/api/supplements":
|
elif parsed.path == "/api/supplements":
|
||||||
self._handle_api_supplements(parsed)
|
self._handle_api_supplements(parsed)
|
||||||
@@ -123,7 +123,8 @@ class Handler(BaseHTTPRequestHandler):
|
|||||||
|
|
||||||
def _handle_app_js(self):
|
def _handle_app_js(self):
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(os.path.dirname(__file__), "app.js"), "rb") as f:
|
fname = self.path.lstrip("/").replace("static/", "")
|
||||||
|
with open(os.path.join(os.path.dirname(__file__), fname), "rb") as f:
|
||||||
js = f.read()
|
js = f.read()
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
self.send_header("Content-Type", "application/javascript; charset=utf-8")
|
self.send_header("Content-Type", "application/javascript; charset=utf-8")
|
||||||
|
|||||||
@@ -10,11 +10,9 @@ server {
|
|||||||
proxy_read_timeout 120s;
|
proxy_read_timeout 120s;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /app.js {
|
location /static/ {
|
||||||
alias /home/naeel/contracts/app.js;
|
proxy_pass http://127.0.0.1:8766;
|
||||||
add_header Content-Type "application/javascript; charset=utf-8";
|
proxy_read_timeout 10s;
|
||||||
add_header Access-Control-Allow-Origin "*";
|
|
||||||
expires 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location /lucee/ {
|
location /lucee/ {
|
||||||
|
|||||||
Reference in New Issue
Block a user