{"action":"closed","issue":{"url":"https://api.github.com/repos/KrekkieD/nocca/issues/25","labels_url":"https://api.github.com/repos/KrekkieD/nocca/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/KrekkieD/nocca/issues/25/comments","events_url":"https://api.github.com/repos/KrekkieD/nocca/issues/25/events","html_url":"https://github.com/KrekkieD/nocca/issues/25","id":60070062,"number":25,"title":"refactor endpoints component to be more general and allow any URL to be forwarded by default","user":{"login":"jhkuperus","id":1083734,"avatar_url":"https://avatars.githubusercontent.com/u/1083734?v=3","gravatar_id":"","url":"https://api.github.com/users/jhkuperus","html_url":"https://github.com/jhkuperus","followers_url":"https://api.github.com/users/jhkuperus/followers","following_url":"https://api.github.com/users/jhkuperus/following{/other_user}","gists_url":"https://api.github.com/users/jhkuperus/gists{/gist_id}","starred_url":"https://api.github.com/users/jhkuperus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhkuperus/subscriptions","organizations_url":"https://api.github.com/users/jhkuperus/orgs","repos_url":"https://api.github.com/users/jhkuperus/repos","events_url":"https://api.github.com/users/jhkuperus/events{/privacy}","received_events_url":"https://api.github.com/users/jhkuperus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-06T07:47:28Z","updated_at":"2015-10-13T15:50:25Z","closed_at":"2015-10-13T15:50:25Z","body":"Right now an endpoint has to be explicitly configured before anything works. It would be nicer if we supported actually proxying requests. The current behaviour could be refactored as an implementation of that more generic way:\r\n\r\n```javascript\r\nendpoints: {\r\n  google: {\r\n    match: Nocca.$endpointMatchers.hostMatcher('google.com'),\r\n    keyGenerator: Nocca.$keyGenerators.urlOnlyKeyGeneratorBuilder()\r\n  },\r\n  ourInternalWebServiceA: {\r\n    match: Nocca.$endpointMatchers.combine(\r\n      Nocca.$endpointMatchers.host('services.internal.us.com'),\r\n      Nocca.$endpointMatchers.urlPrefix('/services/serviceA')\r\n    ),\r\n    keyGenerator: Nocca.$keyGenerators.bodyRegexKeyGeneratorBuilder(/* ... */)\r\n  }\r\n```"}}