guillaumebriday / todolist-backend-laravel

Back-end application for Todolist Web application built with Laravel 5.8 and Vue.js
https://todolist-docs.guillaumebriday.me
MIT License
70 stars 22 forks source link

Installation problem / Exception in browser when you go to http://localhost:8000/ #25

Closed connecteev closed 5 years ago

connecteev commented 5 years ago

@guillaumebriday as you know by now I haven't been able to get the installation to work. Not sure if this is related to the issue I am seeing here: https://github.com/guillaumebriday/todolist-frontend-nuxt/issues/7

But when I go to http://localhost:8000/ I see an exception and call stack in the browser (see below). I would imagine that something is wrong on the server-side (laravel) also, besides the front-end bug on the client-side (which I have linked above).

What am I doing wrong? These are the exact installation steps I went through;

$ git clone https://github.com/guillaumebriday/todolist-backend-laravel.git
$ cd todolist-backend-laravel
$ cp .env.example .env
$ composer install
$ php artisan key:generate
$ php artisan jwt:secret
IMPORTANT: Before running migrate, make sure .env file is updated with:
DB_HOST=127.0.0.1
$ php artisan migrate --seed

Call stack that shows up in the browser:

{
    "message": "",
    "exception": "Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException",
    "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php",
    "line": 179,
    "trace": [
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 634,
            "function": "match",
            "class": "Illuminate\\Routing\\RouteCollection",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 623,
            "function": "findRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 612,
            "function": "dispatchToRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 176,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
            "line": 30,
            "function": "Illuminate\\Foundation\\Http\\{closure}",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/app/Http/Middleware/ForceJson.php",
            "line": 17,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 163,
            "function": "handle",
            "class": "App\\Http\\Middleware\\ForceJson",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/spatie/laravel-cors/src/Cors.php",
            "line": 28,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 163,
            "function": "handle",
            "class": "Spatie\\Cors\\Cors",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/fideloper/proxy/src/TrustProxies.php",
            "line": 57,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 163,
            "function": "handle",
            "class": "Fideloper\\Proxy\\TrustProxies",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 163,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 163,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
            "line": 27,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 163,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php",
            "line": 62,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 163,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 104,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 151,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 116,
            "function": "sendRequestThroughRouter",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/public/index.php",
            "line": 55,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/Users/kunalpunjabi/Code/LARAVEL_WORKING_CODE/NUXT/todolist/todolist-backend-laravel/server.php",
            "line": 21,
            "function": "require_once"
        }
    ]
}
connecteev commented 5 years ago

Note: The error doesn't go away even after I add a routes/web.php file with these contents:

<?php

Route::get('/', function () {
    return 'hi';
});
guillaumebriday commented 5 years ago

Please read the README and this exception.

The purpose of this repository is to provide API with Laravel 5.8 and connecting JavaScript front-end frameworks like Vue.js 2 or other clients to them.

There is no reason to have a web.php or the access this project in a browser.

There is no error, / just does not exist at all for purpose.

You need to use a Client to access this API.

guillaumebriday commented 5 years ago

I already told you here by the way : https://github.com/guillaumebriday/todolist-backend-laravel/issues/9#issuecomment-504622169

connecteev commented 5 years ago

Thanks for the clarification. Everything works fine now after the front-end fix you did.