API when online, returns: 'Route [login] not defined'

Asked

Viewed 140 times

0

I’m testing a API I am developing, in localhost I can make a certain request and it returns to me everything 'ok'. By doing the same test on a server, it is returning a 'Route [login] not defined.' Since I’m not associating any middleware authentication to my API and neither associating in the builder of my controller.

public function getListById($id)
{
    $user = DB::table('dbTestes')->where('id', $id)->get();
    return response()->json($user);
}


//Rota API:

Route::get('/ponto/edit/{id}', 'PontoController@getListById');

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

*I’m accessing the same database.

  • Where are you saying the access URL?

  • meudominio.com/api/...

  • On your router, did you specify that middleware is api? The Laravel tbm has a specific file to create api routes, unlike when you use the web Routes, besides, if for some reason you are in a protected route the Laravel is redirecting you to the login route, which in this case does not exist

  • No, no middleware is defined in the API routes.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.