Explorar o código

API format changes

andryyy %!s(int64=8) %!d(string=hai) anos
pai
achega
8b7e3c718d
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      data/conf/nginx/site.conf

+ 10 - 0
data/conf/nginx/site.conf

@@ -18,6 +18,11 @@ server {
   access_log /var/log/nginx/access.log;
   access_log /var/log/nginx/access.log;
   root /web;
   root /web;
 
 
+  location /api/v1/ {
+    try_files $uri $uri/ /json_api.php?$args;
+  }
+  rewrite ^/api/v1/([^/]+)/([^/]+)/?$ /json_api.php?action=$1&object=$2? last;
+
   location ^~ /.well-known/acme-challenge/ {
   location ^~ /.well-known/acme-challenge/ {
 	  allow all;
 	  allow all;
     default_type "text/plain";
     default_type "text/plain";
@@ -166,6 +171,11 @@ server {
   access_log /var/log/nginx/access.log;
   access_log /var/log/nginx/access.log;
   root /web;
   root /web;
 
 
+  location /api/v1/ {
+    try_files $uri $uri/ /json_api.php?$args;
+  }
+  rewrite ^/api/v1/([^/]+)/([^/]+)/?$ /json_api.php?action=$1&object=$2? last;
+
   location ^~ /.well-known/acme-challenge/ {
   location ^~ /.well-known/acme-challenge/ {
 	  allow all;
 	  allow all;
     default_type "text/plain";
     default_type "text/plain";