Next.js Discord

Discord Forum

I create REST api in Laravel, does it make sense to use route handler (api routes) in next.js

Unanswered
Dwarf Crocodile posted this in #help-forum
Open in Discord
Avatar
Dwarf CrocodileOP
Hello, I am creating the REST API in laravel. Would it make sense to use the route handler structure in Next.js?

login.jsx => route handler will send request, route handler will send laravel request.

Does this structure make sense? Is it nonsense to use the rest api already created in laravel?

2 Replies

Avatar
Southeastern blueberry bee
You're just adding an unnecessary step (in this case, the route handlers). I recommend consuming your laravel api directly from your frontend
Avatar
Dwarf CrocodileOP
thank you 🙂