How to use the fastify-decorators.POST function in fastify-decorators

To help you get started, we’ve selected a few fastify-decorators examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github L2jLiga / fastify-decorators / test / bootstrap-app / other / post.handler.ts View on Github external
/**
 * @license
 * Copyright Andrey Chalkin  (https://github.com/L2jLiga). All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/L2jLiga/fastify-decorators/blob/master/LICENSE
 */

import { POST, RequestHandler } from 'fastify-decorators';

@POST({
    url: '/post',
    options: {
        schema: {
            response: {
                200: {
                    type: 'object',
                    properties: {
                        message: { type: 'string' }
                    }
                }
            }
        }
    }
})
class PostHandler extends RequestHandler {
    async handle() {
github L2jLiga / fastify-decorators / src / handlers / post.handler.ts View on Github external
/**
 * @license
 * Copyright Andrey Chalkin  (https://github.com/L2jLiga). All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/L2jLiga/fastify-decorators/blob/master/LICENSE
 */

import { POST, RequestHandler } from 'fastify-decorators';

@POST({
    url: '/post',
    options: {
        schema: {
            response: {
                200: {
                    type: 'object',
                    properties: {
                        message: { type: 'string' }
                    }
                }
            }
        }
    }
})
class PostHandler extends RequestHandler {
    public async handle(): Promise {

fastify-decorators

Framework aimed to provide useful TypeScript decorators to implement controllers, services and request handlers, built with Fastify.

MIT
Latest version published 1 month ago

Package Health Score

81 / 100
Full package analysis