Closed Darkle closed 1 year ago
Hi there @Darkle, what you are asking for today is currently possible if you create multiple server protocols:
users.getUser 42
posts.getPost 1
where users
and posts
are two different protocols.
Although technically possible, adding namespacing to protocols would mean to nest the records inside other records. I feel like this overcomplicates the implementation and would require a different way to customize the routes. Using multiple protocols is the recommended way ✅
Do you mean something like this?
let posts =
Remoting.createApi ("http://localhost:3002")
|> Remoting.buildProxy<PostsEndpoints>
let users =
Remoting.createApi ("http://localhost:3002")
|> Remoting.buildProxy<UsersEndpoints>
Yes, exactly like that!
Thanks.
Hi, I think it would be super handy if it were possible to namespace endpoints, so that when using the client you could do something like this: