Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/finom/vovk

REST for Next - Transforms Next.js into a powerful and extensible REST API platform
https://github.com/finom/vovk

controller decorators nestjs nextjs nextjs13 nodejs rest-api service threading worker

Last synced: 3 months ago
JSON representation

REST for Next - Transforms Next.js into a powerful and extensible REST API platform

Lists

README

        





vovk


REST for Next


Transforms Next.js into a powerful and extensible REST API platform.


Made with TypeScript, inspired by NestJS.


Website    
Documentation    
Interactive Examples    
vovk-zod    
vovk-hello-world    
vovk-react-native-example



npm version 
TypeScript 
Build status


Example back-end Controller Class:

```ts
import { get, prefix } from 'vovk';

@prefix('hello')
export default class HelloController {
/**
* Return a greeting from
* GET /api/hello/greeting
*/
@get('greeting')
static getHello() {
return { greeting: 'Hello world!' };
}
}
```

Example component that uses the auto-generated client library:

```ts
'use client';
import { useState } from 'react';
import { HelloController } from 'vovk-client';
import type { VovkClientReturnType } from 'vovk';

export default function Example() {
const [
serverResponse, setServerResponse,
] = useState>();

return (
<>
{
setServerResponse(
await HelloController.getHello()
);
}}
>
Get Greeting from Server

{serverResponse?.greeting}

>
);
}
```