Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Custom 404 Page #144

Closed
uvulpos opened this issue Apr 8, 2021 · 3 comments
Closed

Multiple Custom 404 Page #144

uvulpos opened this issue Apr 8, 2021 · 3 comments

Comments

@uvulpos
Copy link
Collaborator

uvulpos commented Apr 8, 2021

Hey there,
I want to build a website with a tiny build in API.

/dashboard → Homepage
/api/getUser → API

My Problem now is: I have an HTML 404 defined, but I want to define a custom JSON 404 for my API mount. But this is not working:

$router->mount('/api', function() use ($router) {
  $router->get('/', 'APIHandler@index');
  $router->set404(function() {
    echo "api nono";
  });
});

So, this is a Feature Request to make 404 in mounts overwritable 😄

@bramus
Copy link
Owner

bramus commented Apr 8, 2021

This is currently not supported yet I'd happily accept a PR that provides this.

@uvulpos
Copy link
Collaborator Author

uvulpos commented May 12, 2021

Hey @bramus,

would be great, if you could review my PRs 😄
This is just a little poke that my PRs are ready to merge

bramus added a commit that referenced this issue May 12, 2021
@bramus
Copy link
Owner

bramus commented May 12, 2021

@uvulpos Thanks for the reminder … merged!

@bramus bramus closed this as completed May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants