JSON:API redirections 404 not found needed

45 views
Skip to first unread message

arava-el

unread,
Jul 10, 2019, 12:38:13 PM7/10/19
to Fat-Free Framework
Good day to you all!

I have been familiarized with JSON:API (https://jsonapi.org)... In this document I have read this one:
`A server MUST return `404 Not Found` when processing a request to fetch a link URL that does not exist...`

Okay, look... I have a routes.conf that consists of available routes, for example:
GET /api/v1/@token/getDirections=ApiController->getDirections
everything is stable...
If I will try to fetch some data from link that does not exist I will be moved to the URL that have defined already
in this section:
routes.conf
[redirects]
POST|GET /*= /index

So, my question is: How to make APIs `404` response if route does not exist at all? Because as I realize, if route does not
exist, F3 will set `301 Moved permanently` first, and then will redirected to the `/index (200 OK)` route. As you see, there is no
`404` as JSON:API needed...
But I want to mention that this is only for API, simple scheme should work anyway...

Hope, its clear, thx

arava el

unread,
Jul 10, 2019, 1:14:13 PM7/10/19
to arava-el via Fat-Free Framework, Fat-Free Framework
I think I wrote a mess, sorry guys... I made everything I need!
Need to get rest I suppose

--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to f3-framework...@googlegroups.com.
To post to this group, send email to f3-fra...@googlegroups.com.
Visit this group at https://groups.google.com/group/f3-framework.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/7b2da13e-3437-4923-a9cd-0919efbf359d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages