A way to build a URL route
See original GitHub issueHello!
I have a service with eight http endpoints and i need to build urls for it with multiple different parameters. Are there any way to implement something like url_for
in flask:
Example:
class Service:
@http('GET', '/url-one/<token>')
def handle_url_one(self, request, token):
pass
@rpc
def get_url_one(self):
return '/url-one/' + token # This is not DRY and error-prone approach
# Wanted: return self.url_for(self.handle_url_one, token)
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to: Construct a URL from a Route | Microsoft Learn
To create a URL ... Call the GetVirtualPath method of the RouteCollection class and pass the RouteValueDictionary object to construct the URL. To ......
Read more >java - Is there a right way to build a URL? - Stack Overflow
You can use Apache URIBuilder. Sample code: Full Apache Example URIBuilder builder = new URIBuilder() .setScheme("http") .setHost("apache.org") .
Read more >URLs and Routing - Meteor Guide
In a web application, routing is the process of using URLs to drive the user interface (UI). URLs are a prominent feature in...
Read more >How to Build a Simple Router in JavaScript using Window ...
A router watches for changes in the URL and calls the appropriate function. The method is then responsible for rendering the view.
Read more >Six Factors for Better URL Path Design in Web Apps
1. Dealing with Public and Private URL Paths · 2. Deciding When to Use Paths and Parameters to Store Application State · 3....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have created basic implementation. Check it out: https://gist.github.com/asyncee/afff12559e364b0665c89b0e53341c28
This issue was moved to https://discourse.nameko.io/t/a-way-to-build-a-url-route/299