Api: Lumen 5.2 Support route NotFoundHttpException

Created on 29 Jan 2016  路  5Comments  路  Source: dingo/api

Am I doing anything wrong or missing something?

I am accessing this via : php -S localhost:8000 -t public at localhost:8000/api/hello

with configurations:

API_STANDARDS_TREE=vnd
API_SUBTYPE=core
API_DOMAIN=api.site.com
API_VERSION=v1
API_NAME="Core API"
API_CONDITIONAL_REQUEST=false
API_STRICT=false
API_DEFAULT_FORMAT=json
API_DEBUG=true

routes.php

$api = $app['api.router'];

$api->version('v1',['prefix' => 'api'],function($api){
    $api->get('hello',function(){
       return "hello";
    });
});

bootstrap/app.php
$app->register(Dingo\Api\Provider\LumenServiceProvider::class)

Error:

NotFoundHttpException in RoutesRequests.php line 438:
in RoutesRequests.php line 438
at Application->handleDispatcherResponse(array('0')) in RoutesRequests.php line 377
at Application->Laravel\Lumen\Concerns\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) in Request.php line 95
at Request->handle(object(Request), object(Closure))
at call_user_func_array(array(object(Request), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in RoutesRequests.php line 617
at Application->sendThroughPipeline(array('Dingo\Api\Http\Middleware\Request'), object(Closure)) in RoutesRequests.php line 378
at Application->dispatch(null) in RoutesRequests.php line 323
at Application->run() in index.php line 28

Most helpful comment

@geocine try

  • $app->register(\Dingo\Api\Provider\LumenServiceProvider::class); with a backslash before Dingo
  • API_DOMAIN=localhost

All 5 comments

@geocine try

  • $app->register(\Dingo\Api\Provider\LumenServiceProvider::class); with a backslash before Dingo
  • API_DOMAIN=localhost

@lucasmichot Many thanks! it was the API_DOMAIN that was causing the issue.

You're welcome!

You save my life today, after looking for 4hours for solution..
i have public IP without domain, in my .env still localhost, after i change to IP, the program run now
many thanks

Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lloricode picture lloricode  路  3Comments

sukh-gill picture sukh-gill  路  3Comments

Kirtsen picture Kirtsen  路  3Comments

pedrolari picture pedrolari  路  3Comments

HTMHell picture HTMHell  路  4Comments