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

API Middleware #65

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

API Middleware #65

wants to merge 4 commits into from

Conversation

montanaflynn
Copy link

I made a small API middleware class to send errors for missing endpoints and circumvent the 404 page. A few other things are planned as well. Cheers!

// Move along to next call
$this->next->call();

// But wait! Let's add support for jsonp callbacks
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The middleware class with the same functionality already exists here: Middleware/Jsonp.php

@montanaflynn
Copy link
Author

That only handles jsonp callback functions, and I referenced it in a commit.

Mine enures routes and bypasses slims 404 page. Anyways I use this as a starting template for my APIs and thought it would be useful for others as well. The catch all route was exceedingly hard to find documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants