mirror of
https://codeberg.org/vlw/victorwesterlund.com.git
synced 2025-09-14 11:33:41 +02:00
Move api.php to /src
This commit is contained in:
parent
cb6a0e9ec5
commit
64db7544b7
2 changed files with 3 additions and 3 deletions
|
@ -8,9 +8,9 @@
|
|||
<ol>
|
||||
<li><strong>Clone this repo.</strong><br><pre>git clone https://github.com/VictorWesterlund/victorwesterlund.com /var/www</pre></li>
|
||||
<li><strong>Expose the directory <code>/public</code> to the web.</strong><br>This can be done in multiple ways, but an <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#location">NGINX <code>location</code> block</a> or symlink should do the trick.</li>
|
||||
<li><strong>Rewrite <code>api.php</code> to <code>api/*</code>.</strong><br>All requests to <code>example.com/api/*</code> should be routed to the PHP file at <code>/public/api.php</code>.<br>Just like the previous step, this can be done in multiple ways. Here is one way with an NGINX location block:<br>
|
||||
<li><strong>Rewrite <code>api.php</code> to <code>api/*</code>.</strong><br>All requests to <code>example.com/api/*</code> should be routed to the PHP file at <code>/src/api.php</code>.<br>Just like the previous step, this can be done in multiple ways. Here is one way with an NGINX location block:<br>
|
||||
<pre>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;
|
||||
}</pre></li>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
];
|
Loading…
Add table
Reference in a new issue