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)
|
||||
elif parsed.path == "/health":
|
||||
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()
|
||||
elif parsed.path == "/api/supplements":
|
||||
self._handle_api_supplements(parsed)
|
||||
@@ -123,7 +123,8 @@ class Handler(BaseHTTPRequestHandler):
|
||||
|
||||
def _handle_app_js(self):
|
||||
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()
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", "application/javascript; charset=utf-8")
|
||||
|
||||
@@ -10,11 +10,9 @@ server {
|
||||
proxy_read_timeout 120s;
|
||||
}
|
||||
|
||||
location = /app.js {
|
||||
alias /home/naeel/contracts/app.js;
|
||||
add_header Content-Type "application/javascript; charset=utf-8";
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
expires 0;
|
||||
location /static/ {
|
||||
proxy_pass http://127.0.0.1:8766;
|
||||
proxy_read_timeout 10s;
|
||||
}
|
||||
|
||||
location /lucee/ {
|
||||
|
||||
Reference in New Issue
Block a user