Skip to content

Instantly share code, notes, and snippets.

View pleerock's full-sized avatar

Umed Khudoiberdiev pleerock

View GitHub Profile
@JsonController()
export class BlogController {
@Get("/blogs")
getAll() {
if (accessAllowed)
throw new ForbiddenError("Access is denied");
return [
{ id: 1, name: "Blog " + filter.keyword },
import {JsonController} from "routing-controllers";
import {Get, Post, Put, Patch, Delete} from "routing-controllers";
import {QueryParam, Param, Body} from "routing-controllers";
@JsonController()
export class BlogController {
@Get("/blogs")
getAll(@QueryParam("keyword", { required: true }) keyword: string) {
return [