tsed-getting-started icon indicating copy to clipboard operation
tsed-getting-started copied to clipboard

How to change the /rest prefix?

Open DonsWayo opened this issue 5 years ago • 5 comments

I try to change the /rest in the routing, on swagger is show this prefix. I try to restart several times but I think is not rebuild the swagger docs. Any tip?

DonsWayo avatar Oct 21 '19 11:10 DonsWayo

for me also happens the same

rrdlpl avatar Oct 23 '19 06:10 rrdlpl

Can you send me tour server config please :)

Romakita avatar Oct 23 '19 07:10 Romakita

Hi @DonsWayo I checked out the documentation and in your Server class you can add to the @ServerSettings decorator the mount option. Checkout mine as an example:

@ServerSettings({
  rootDir,
  acceptMimes: ["application/json"],
  httpPort: 5000,
  mount: {
    "/": "${rootDir}/controllers/**/*.ts",
  },
  logger: {
    debug: true,
    logRequest: true,
    requestFields: ["reqId", "method", "url", "headers", "query", "params", "duration"]
  },
  swagger: {
    path: "/docs"
  },
  calendar: {
    token: true
  },
  debug: true
})

rrdlpl avatar Oct 23 '19 07:10 rrdlpl

Ho yes isn't configurable... I fix that ASAP

Romakita avatar Oct 24 '19 12:10 Romakita

@DonsWayo @rrdlpl,

Ho ok is see where come from the mistake. Did you seen you have a RestCtrl in the getting-started example ? You have to remove it also, because the controller is loaded automatically by tsed according to your configure :) I added a branch with the some change to help you: https://github.com/TypedProject/tsed-getting-started/commit/31fcca434a78c64ee8458ae35f33878ee3bd848a

See you Romain

Romakita avatar Oct 26 '19 13:10 Romakita