allow methods
This commit is contained in:
@ -2,7 +2,7 @@ import { Controller, Get, Post, Body, Param, Header, Delete } from '@nestjs/comm
|
||||
import {StoreService} from './store.service';
|
||||
import {Store, StoreResponse, StoreRequest} from './store.schema';
|
||||
import {ApiResponse} from '@nestjs/swagger';
|
||||
import {ALLOW_ORIGIN_ALL} from 'src/consts';
|
||||
import {ALLOW_ORIGIN_ALL, ALLOW_METHOD} from 'src/consts';
|
||||
|
||||
@Controller('store')
|
||||
export class StoreController {
|
||||
@ -12,6 +12,7 @@ export class StoreController {
|
||||
|
||||
@Get()
|
||||
@Header(...ALLOW_ORIGIN_ALL)
|
||||
@Header(...ALLOW_METHOD)
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description: 'Список всех пар ключ-значение',
|
||||
@ -23,6 +24,7 @@ export class StoreController {
|
||||
|
||||
@Get(':key')
|
||||
@Header(...ALLOW_ORIGIN_ALL)
|
||||
@Header(...ALLOW_METHOD)
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description: 'Возвращает пару ключ-значение по ключу',
|
||||
@ -34,6 +36,7 @@ export class StoreController {
|
||||
|
||||
@Post()
|
||||
@Header(...ALLOW_ORIGIN_ALL)
|
||||
@Header(...ALLOW_METHOD)
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description: 'Создает новую пару ключ-значение или заменяет существующую по ключу',
|
||||
@ -45,6 +48,7 @@ export class StoreController {
|
||||
|
||||
@Delete(':key')
|
||||
@Header(...ALLOW_ORIGIN_ALL)
|
||||
@Header(...ALLOW_METHOD)
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description: 'Удаляет пару ключ-значение по ключу',
|
||||
|
||||
Reference in New Issue
Block a user