| Crates.io | vovk_hello_world |
| lib.rs | vovk_hello_world |
| version | 0.0.87 |
| created_at | 2025-07-11 19:35:54.718443+00 |
| updated_at | 2026-01-15 06:52:18.141884+00 |
| description | A "Hello World!" app built with Next.js, Vovk.ts and Zod. For details, visit https://vovk.dev/hello-world |
| homepage | https://vovk.dev/hello-world |
| repository | https://github.com/finom/vovk-hello-world.git |
| max_upload_size | |
| id | 1748384 |
| size | 98,854 |
A "Hello World!" app built with Next.js, Vovk.ts and Zod. For details, visit https://vovk.dev/hello-world
License: MIT
# Install the package
cargo install vovk_hello_world
Update user
Update user by ID
POST https://hello-world.vovk.dev/api/users/{id}
use vovk_hello_world::user_rpc;
use serde_json::{
from_value,
json
};
#[tokio::main]
async fn main() {
let response = user_rpc::update_user(
from_value(json!({
// -----
// User data object
// -----
// User email
"email": "john@example.com",
// User profile object
"profile": {
// User full name
"name": "John Doe",
// User age
"age": 25
}
})).unwrap(), /* body */
from_value(json!({
// -----
// Query parameters
// -----
// Notification type
"notify": "email"
})).unwrap(), /* query */
from_value(json!({
// -----
// Path parameters
// -----
// User ID
"id": "123e4567-e89b-12d3-a456-426614174000"
})).unwrap(), /* params */
None, /* headers (HashMap) */
None, /* api_root */
false, /* disable_client_validation */
).await;
match response {
Ok(output) => println!("{:?}", output),
/*
output {
// -----
// Response object
// -----
// Success status
success: true,
// User ID
id: "00000000-0000-0000-0000-000000000000",
// Notification type
notify: "email"
}
*/
Err(e) => println!("error: {:?}", e),
}
}
Stream tokens
Stream tokens to the client
GET https://hello-world.vovk.dev/api/streams/tokens
use vovk_hello_world::stream_rpc;
use serde_json::{
from_value,
json
};
use futures_util::StreamExt;
#[tokio::main]
async fn main() {
let response = stream_rpc::stream_tokens(
(), /* body */
(), /* query */
(), /* params */
None, /* headers (HashMap) */
None, /* api_root */
false, /* disable_client_validation */
).await;
match response {
Ok(mut stream) => {
let mut i = 0;
while let Some(item) = stream.next().await {
match item {
Ok(value) => {
println!("#{}: {:?}", i, value);
/*
#0: iteration {
// -----
// Streamed token object
// -----
// Message from the token
message: "string"
}
*/
i += 1;
}
Err(e) => {
eprintln!("stream error: {:?}", e);
break;
}
}
}
},
Err(e) => println!("Error initiating stream: {:?}", e),
}
}
OpenAPI spec
Get the OpenAPI spec for the "Hello World" app API
GET https://hello-world.vovk.dev/api/static/openapi.json
use vovk_hello_world::open_api_rpc;
use serde_json::{
from_value,
json
};
#[tokio::main]
async fn main() {
let response = open_api_rpc::get_spec(
(), /* body */
(), /* query */
(), /* params */
None, /* headers (HashMap) */
None, /* api_root */
false, /* disable_client_validation */
).await;
}