Jun 13, 2018
0
Level 2
Hide /api/ endpoints when accessing through web
I created my api on Laravel using Dingo. The api is to be accessed by mobile applications and other clients. I have a website running with some static pages, and the api is also hosted on the same domain. When navigating through any of the api endpoints I would get messages such as 404 not found in JSON (the api is returning it), or I could access an endpoint that would return results that is supposed to be called from a 3rd party client. How can I 'hide' those endpoints from being accessed by a browser? Maybe a redirect to the home pages?
Please or to participate in this conversation.