Something like this:
// Contract.res
let getPost = Rest.rpc(() => {
input: S.string,
output: postSchema
})
// Client.res
let post = await Contract.getPost->Rest.fetch(url, "post_1")
// Server.res
app->Hono.route(Contract.getPost, async ({input: postId}) => {
posts->Dict.getUnsafe(postId)
}
What do you think?