{"action":"created","issue":{"url":"https://api.github.com/repos/noflo/noflo-xpress/issues/3","labels_url":"https://api.github.com/repos/noflo/noflo-xpress/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/noflo/noflo-xpress/issues/3/comments","events_url":"https://api.github.com/repos/noflo/noflo-xpress/issues/3/events","html_url":"https://github.com/noflo/noflo-xpress/issues/3","id":96300635,"number":3,"title":"Create a Resource router component","user":{"login":"bergie","id":3346,"avatar_url":"https://avatars.githubusercontent.com/u/3346?v=3","gravatar_id":"","url":"https://api.github.com/users/bergie","html_url":"https://github.com/bergie","followers_url":"https://api.github.com/users/bergie/followers","following_url":"https://api.github.com/users/bergie/following{/other_user}","gists_url":"https://api.github.com/users/bergie/gists{/gist_id}","starred_url":"https://api.github.com/users/bergie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergie/subscriptions","organizations_url":"https://api.github.com/users/bergie/orgs","repos_url":"https://api.github.com/users/bergie/repos","events_url":"https://api.github.com/users/bergie/events{/privacy}","received_events_url":"https://api.github.com/users/bergie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-21T12:05:55Z","updated_at":"2015-07-21T15:27:36Z","closed_at":null,"body":"One common use case for making servers is exposing RESTful APIs, and so the easier we can make this the better.\r\n\r\nThe resource router could be somewhat inspired by https://www.npmjs.com/package/resourcemap and expose outports for the different REST operations on a resource.\r\n\r\nSomething like:\r\n\r\n```\r\n'/user' -> PATH UserResource(xpress/Resource)\r\nUserResource LIST -> REQ ListUsers # GET /user\r\nUserResource SHOW -> REQ ShowUser # GET /user/:name\r\nUserResource UPDATE -> REQ UpdateUser # PUT /user/:name\r\nUserResource DELETE -> REQ DeleteUser # DELETE /user/:name\r\n```\r\n\r\nnon-connected outports should result in either 404 or 405 depending on the case"},"comment":{"url":"https://api.github.com/repos/noflo/noflo-xpress/issues/comments/123370040","html_url":"https://github.com/noflo/noflo-xpress/issues/3#issuecomment-123370040","issue_url":"https://api.github.com/repos/noflo/noflo-xpress/issues/3","id":123370040,"user":{"login":"bergie","id":3346,"avatar_url":"https://avatars.githubusercontent.com/u/3346?v=3","gravatar_id":"","url":"https://api.github.com/users/bergie","html_url":"https://github.com/bergie","followers_url":"https://api.github.com/users/bergie/followers","following_url":"https://api.github.com/users/bergie/following{/other_user}","gists_url":"https://api.github.com/users/bergie/gists{/gist_id}","starred_url":"https://api.github.com/users/bergie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergie/subscriptions","organizations_url":"https://api.github.com/users/bergie/orgs","repos_url":"https://api.github.com/users/bergie/repos","events_url":"https://api.github.com/users/bergie/events{/privacy}","received_events_url":"https://api.github.com/users/bergie/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T15:27:36Z","updated_at":"2015-07-21T15:27:36Z","body":"For example in noflo-ui we use chained routers for flux-y events. All events from the UI go to \"Dispatch\" (a `GroupRouter`), which sends them to the appropriate \"storage graph\", where we use another `GroupRouter` to send it to the correct flow.\r\n\r\nSo packet with groups:\r\n\r\n```\r\n< project\r\n< create\r\n{ name: 'baz'}\r\n> create\r\n> project\r\n```\r\n\r\nEnds up going to the \"Project\" sub-router, where it gets routed to the flow handling project creation."}}