Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
matejbucek committed Aug 25, 2022
2 parents c684f33 + 1d16ccd commit 2ba3bee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/controllers/rest.controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Inject, Constant, Controller, Get } from "@tsed/common";
import { ContentType, Description, Summary } from "@tsed/schema";
import { ContentType, Description, Returns, Summary } from "@tsed/schema";
import { SwaggerSettings } from "@tsed/swagger";
import moment from "moment";
import { KeycloakAuth } from "src/decorators/KeycloakAuthOptions.decorator";
Expand All @@ -13,6 +13,7 @@ export class RestController {
@Get("/")
@Summary("Root route of the API")
@Description("Return a message and time.")
@Returns(200, Object)
get() {
return {
message: "hello world!",
Expand All @@ -21,6 +22,9 @@ export class RestController {
}

@Get("/protected")
@Summary("Protected route of the API")
@Description("Return a greeting when user is authenticated.")
@Returns(200, Object)
@KeycloakAuth({ role: "realm:user" })
protected() {
return { "test": "ahoj" };
Expand Down

0 comments on commit 2ba3bee

Please sign in to comment.