add support for a route() helper to get fully qualified URLs of HTTP endpoints at runtime
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.5k
- Forks
- 212
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 119
Description
For HTTP endpoints declared via @endpoint like so:
@endpoint({ get: '/assets/{assetName}' })
async myMethod(assetName: string) {
....
}
It would be great to have a helper function to obtain the fully qualified URL of such an endpoint - incl. domain/hostname of the golem deployment. The existing createWebhook() helper already returns a FQ URL.
Ideally the helper function should support:
- generating FQ urls (ie. http://mygolemhost.com/assets/myasset)
- absolute URLs without hostname (ie. /assets/myasset)
- a flag to control if https or http will get get returned
The helper method must be able to accept (and validate) named route args for both: path and query args.
Immediate use cases:
- serving assets and rendering these URLs in templates / html
- sending out signup / confirmation links via email
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the existing createWebhook() helper and the @endpoint declarations described in the issue. Define the helper's behavior for fully qualified and hostname-free URLs, HTTP versus HTTPS, and validated path and query arguments; done means all listed URL forms and immediate use cases are supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100