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

Improvement in router.js #47

Closed
2 tasks done
LaLeonie opened this issue Nov 29, 2019 · 0 comments
Closed
2 tasks done

Improvement in router.js #47

LaLeonie opened this issue Nov 29, 2019 · 0 comments

Comments

@LaLeonie
Copy link

LaLeonie commented Nov 29, 2019

It's best to make your if-conditions in the router.js as specific as possible. This can prevent bugs if you're adding more routes later on. For example:

  • else if (endpoint.includes("public")) would be better as else if (endpoint.startsWith(“public")) as there might be other endpoints in the future which include the word public

  • the if-statement for your API calls, can be more specific as well. At the moment, this catches any route that includes q. You could use “/?q” instead

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

No branches or pull requests

2 participants