I'm trying to deploy my project on a server, Its a RESTAPI. the server is running apache and is working properly (I tested it with a hello world script).
My project itself is in /var/API.
I've moved my public folder from my project to my document root (
I've altered my
index.php document from my laravel project and added it to my document root, along with my
public/.htaccess. The problem I'm having lies in my altered
index.php file posted below.
If I run a get API call i get a 404 error in my browser. If I just run the ip for the server itself I get a 500 error.
<?php define('LARAVEL_START', microtime(true)); require __DIR__.'/var/API/vendor/autoload.php'; $app = require_once __DIR__.'/var/API/bootstrap/app.php'; $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); $response = $kernel->handle( $request = Illuminate\Http\Request::capture() ); $response->send(); $kernel->terminate($request, $response);
Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.