My opinion on this is that having classes "GitHubHandler" and "NPMHandler" depending on the url would work well. In that case the URL handler could be an argument passed to the handler and would be acted upon inside there.
Another solution could be to have a base class "Handler" that the two above mentioned classes extend, which can implement a generic URL handler.
Whether or not we do it one of those ways doesn't really matter as much as considering what will surround the URL handler function.
My opinion on this is that having classes "GitHubHandler" and "NPMHandler" depending on the url would work well. In that case the URL handler could be an argument passed to the handler and would be acted upon inside there.
Another solution could be to have a base class "Handler" that the two above mentioned classes extend, which can implement a generic URL handler.
Whether or not we do it one of those ways doesn't really matter as much as considering what will surround the URL handler function.