diff --git a/README.md b/README.md
index 5df3583..1a0bc48 100644
--- a/README.md
+++ b/README.md
@@ -8,9 +8,9 @@
- Clone this repo.
git clone https://github.com/VictorWesterlund/victorwesterlund.com /var/www
- Expose the directory
/public
to the web.
This can be done in multiple ways, but an NGINX location
block or symlink should do the trick.
- - Rewrite
api.php
to api/*
.
All requests to example.com/api/*
should be routed to the PHP file at /public/api.php
.
Just like the previous step, this can be done in multiple ways. Here is one way with an NGINX location block:
+ - Rewrite
api.php
to api/*
.
All requests to example.com/api/*
should be routed to the PHP file at /src/api.php
.
Just like the previous step, this can be done in multiple ways. Here is one way with an NGINX location block:
location ~ /api/* {
- try_files /public/api.php =503;
+ try_files /src/api.php =503;
include snippets/fastcgi-php.local.conf;
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
}
diff --git a/public/api.php b/src/api.php
similarity index 91%
rename from public/api.php
rename to src/api.php
index 1ab2094..9981d00 100644
--- a/public/api.php
+++ b/src/api.php
@@ -5,7 +5,7 @@
// List of implemented API services
$this->services = [
"search" => function() {
- require_once dirname(__DIR__,1)."/src/search/Search.php";
+ require_once "/search/Search.php";
new Search();
}
];