We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Nim it maybe ..
type MyType* = object first, second, third: string proc parseMyType*(data: string): MyType = MyType( first: data[0], second: data[1], third: data[2] ) registerRouteParamType( "my_type", # unique type identifier "\d\w\d", # type pattern parseMyType # proc/func that takes one string argument and returns any data ) serve "127.0.0.1", 5000: get "/{i:my_type}": echo i.first echo i.second echo i.third
Python:
class MyUniqueIdentifier: def __init__(self, data: str): self.identifier = int(data) register_route_param_type("my_unique_id", r"\d+", MyUniqueIdentifier) @app.get("/registered/{data:my_unique_id}") def handle(data: MyUniqueIdentifier): print(data.identifier) return {'response': data.identifier}
The text was updated successfully, but these errors were encountered:
solve #125
e42676c
Ethosa
No branches or pull requests
In Nim it maybe ..
Python:
The text was updated successfully, but these errors were encountered: