{"id":28436881,"url":"https://github.com/moleculerjs/sandbox-moleculer-api-routing","last_synced_at":"2025-08-03T19:10:59.047Z","repository":{"id":44112903,"uuid":"191371495","full_name":"moleculerjs/sandbox-moleculer-api-routing","owner":"moleculerjs","description":"Moleculer API Gateway routing sandbox on Codesandbox.io","archived":false,"fork":false,"pushed_at":"2022-12-06T18:45:07.000Z","size":216,"stargazers_count":3,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T23:07:51.818Z","etag":null,"topics":["api-gateway","moleculer","moleculer-sandbox"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/github/moleculerjs/sandbox-moleculer-api-routing","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moleculerjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-11T12:54:57.000Z","updated_at":"2020-06-09T23:49:49.000Z","dependencies_parsed_at":"2023-01-23T12:05:14.056Z","dependency_job_id":null,"html_url":"https://github.com/moleculerjs/sandbox-moleculer-api-routing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moleculerjs%2Fsandbox-moleculer-api-routing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moleculerjs%2Fsandbox-moleculer-api-routing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moleculerjs%2Fsandbox-moleculer-api-routing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moleculerjs%2Fsandbox-moleculer-api-routing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moleculerjs","download_url":"https://codeload.github.com/moleculerjs/sandbox-moleculer-api-routing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moleculerjs%2Fsandbox-moleculer-api-routing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258895169,"owners_count":22774307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-gateway","moleculer","moleculer-sandbox"],"created_at":"2025-06-05T23:07:51.787Z","updated_at":"2025-06-27T20:32:07.972Z","avatar_url":"https://github.com/moleculerjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Moleculer Routing Examples\r\n\r\nRouting examples from Moleculer Web Examples repository:\r\n\r\n[https://github.com/moleculerjs/moleculer-web/tree/master/examples](https://github.com/moleculerjs/moleculer-web/tree/master/examples)\r\n\r\n## Default Route Settings\r\n\r\nAccess to all services through the **'/simple'** route.\r\n\r\nUses API Gateway service with default settings.\r\n\r\nAccess greeter.\\*, math.\\* \u0026 internal \\$node.\\* actions.\r\n\r\n#### Examples:\r\n\r\n- Greeter Moleculer\r\n  `GET` [`/simple/v1/greeter/hello`](/simple/v1/greeter/hello)\r\n- Add two numbers\r\n  `GET`\r\n  [`/simple/math/add?a=25\u0026b=13`](/simple/math/add?a=25\u0026b=13)\r\n- Get health info\r\n  `GET` [`/simple/~node/health`](/simple/~node/health)\r\n- List of actions\r\n  `GET` [`/simple/~node/actions`](/simple/~node/actions)\r\n\r\nOfficial Documentation:\r\n[https://moleculer.services/docs/0.13/moleculer-web.html\\#Aliases](https://moleculer.services/docs/0.13/moleculer-web.html#Aliases)\r\n\r\n## Auto-aliases generator\r\n\r\nAccess to all services through the **'/autoalias'** route.\r\n\r\nUses API Gateway service auto-aliases generator feature\r\n\r\nYou don't need to create aliases for your actions.\r\n\r\nIt collects \u0026 read from action definitions \u0026 build aliases.\r\n\r\n#### Examples:\r\n\r\n- Get all users\r\n  `GET` [`/autoalias/users`](/autoalias/users)\r\n- Create a new user\r\n  `POST` [`/autoalias/users`](/autoalias/users)\r\n\r\n  `Body { \"name\": \"Razvan Predescu\" }`\r\n\r\n- Get an user by ID\r\n  `GET` [`/autoalias/users/11`](/autoalias/users/11)\r\n- Update an user by ID\r\n  `PUT` [`/autoalias/users/11`](/autoalias/users/11)\\\r\n\r\n  `Body { \"name\": \"Updated User Name\" }`\r\n\r\n- Remove an user by ID\r\n  `DELETE` [`/autoalias/users/11`](/autoalias/users/11)\r\n\r\nOfficial Documentation:\r\n[https://moleculer.services/docs/0.13/moleculer-web.html\\#Aliases](https://moleculer.services/docs/0.13/moleculer-web.html#Aliases)\r\n\r\n## REST aliases\r\n\r\nThis route uses API Gateway as a RESTful API server\r\n\r\nAccess 'articles' service through the **'/rest'** route.\r\n\r\n#### Examples:\r\n\r\n- Get all articles\r\n  `GET` [`/rest/articles`](/rest/articles)\r\n- Create a new article\r\n  `POST` [`/rest/articles`](/rest/articles)\r\n\r\n  `Body { \"title\": \"New article via REST\" }`\r\n\r\n- Get an article by ID\r\n  `GET` [`/rest/articles/11`](/rest/articles/11)\r\n- Update an article by ID\r\n  `PUT` [`/rest/articles/11`](/rest/articles/11)\\\r\n\r\n  `Body { \"title\": \"Modified article title\" }`\r\n\r\n- Remove an article by ID\r\n  `DELETE` [`/rest/articles/11`](/rest/articles/11)\r\n\r\n## Shorthand RESTful aliases\r\n\r\nShorthand RESTful aliases\r\n\r\nAccess 'articles' service through the **'/shortrest'** route.\r\n\r\nDisable direct URLs (\\`/articles/list\\` or \\`/articles.list\\`)\r\n\r\n#### Examples:\r\n\r\n- Get all articles\r\n  `GET` [`/shortrest/articles`](/shortrest/articles)\r\n- Create a new article\r\n  `POST` [`/shortrest/articles`](/shortrest/articles)\r\n\r\n  `Body { \"title\": \"New article via REST\" }`\r\n\r\n- Get an article by ID\r\n  `GET` [`/shortrest/articles/11`](/shortrest/articles/11)\r\n- Update an article by ID\r\n  `PUT` [`/shortrest/articles/11`](/shortrest/articles/11)\r\n\r\n  `Body { \"title\": \"Modified article title\" }`\r\n\r\n- Remove an article by ID\r\n  `DELETE`\r\n  [`/shortrest/articles/11`](/shortrest/articles/11)\r\n\r\nOfficial Documentation:\r\n[https://moleculer.services/docs/0.13/moleculer-web.html\\#Aliases](https://moleculer.services/docs/0.13/moleculer-web.html#Aliases)\r\n\r\n## Route Whitelisting\r\n\r\nAccess to all services through the **'/whitelist'** route.\r\n\r\nProvides access to certain services \u0026 actions\r\n\r\nServices and actions outside the whitelist are not accessible.\r\n\r\n#### Examples:\r\n\r\n- Greeter Hello\r\n  `GET`\r\n  [`/whitelist/v1/greeter/hello`](/whitelist/v1/greeter/hello)\r\n- Add two numbers\r\n  `GET`\r\n  [`/whitelist/math/add?a=25\u0026b=13`](/whitelist/math/add?a=25\u0026b=13)\r\n\r\nOfficial Documentation:\r\n[https://moleculer.services/docs/0.13/moleculer-web.html\\#Whitelist](https://moleculer.services/docs/0.13/moleculer-web.html#Whitelist)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoleculerjs%2Fsandbox-moleculer-api-routing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoleculerjs%2Fsandbox-moleculer-api-routing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoleculerjs%2Fsandbox-moleculer-api-routing/lists"}