A "Hello World!" app built with Next.js, Vovk.ts and Zod. For details, visit https://vovk.dev/hello-world
npm install vovk-hello-world> A "Hello World!" app built with Next.js, Vovk.ts and Zod. For details, visit https://vovk.dev/hello-world
License: MIT
``bash`Install the package
npm install vovk-hello-world
Update user by ID
POST https://hello-world.vovk.dev/api/users/{id}
`ts
import { UserRPC } from 'vovk-hello-world';
const response = await UserRPC.updateUser({
body: {
// -----
// User data object
// -----
// User email
email: "john@example.com",
// User profile object
profile: {
// User full name
name: "John Doe",
// User age
age: 25
}
},
query: {
// -----
// Query parameters
// -----
// Notification type
notify: "email"
},
params: {
// -----
// Path parameters
// -----
// User ID
id: "123e4567-e89b-12d3-a456-426614174000"
},
});
console.log(response);
/*
{
// -----
// Response object
// -----
// Success status
success: true,
// User ID
id: "00000000-0000-0000-0000-000000000000",
// Notification type
notify: "email"
}
*/
`
Stream tokens to the client
GET https://hello-world.vovk.dev/api/streams/tokens
`ts
import { StreamRPC } from 'vovk-hello-world';
using response = await StreamRPC.streamTokens();
for await (const item of response) {
console.log(item);
/*
{
// -----
// Streamed token object
// -----
// Message from the token
message: "string"
}
*/
}
`
Get the OpenAPI spec for the "Hello World" app API
GET https://hello-world.vovk.dev/api/static/openapi.json
`ts
import { OpenApiRPC } from 'vovk-hello-world';
const response = await OpenApiRPC.getSpec();
``