Skip to content

Commit

Permalink
Don't add routes.ts suffix for absolute routesDir paths
Browse files Browse the repository at this point in the history
  • Loading branch information
HoldYourWaffle committed Jun 10, 2019
1 parent f7c0f17 commit 8ee0a96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routeGeneration/routeGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class RouteGenerator {
constructor(private readonly metadata: Tsoa.Metadata, private readonly options: RoutesConfig) { }

public async GenerateRoutes(middlewareTemplate: string, pathTransformer: (path: string) => string) {
const fileName = `${this.options.routesDir}/routes.ts`;
const fileName = path.isAbsolute(this.options.routesDir) ? this.options.routesDir : `${this.options.routesDir}/routes.ts`;
const content = this.buildContent(middlewareTemplate, pathTransformer);

const formatted = await tsfmt.processString(fileName, content, this.tsfmtConfig as any);
Expand Down

0 comments on commit 8ee0a96

Please sign in to comment.