Skip to content

Commit

Permalink
fix: express option bug in init command (#10022)
Browse files Browse the repository at this point in the history
* Fix express option bug in init command

* fixed esm support in command

* fix linter

---------

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
  • Loading branch information
youngkiu and pleerock committed May 9, 2023
1 parent 2a2bb4b commit 5be20e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commands/InitCommand.ts
Expand Up @@ -377,7 +377,9 @@ export const Routes = [{
* Gets contents of the user controller file (used when express is enabled).
*/
protected static getControllerTemplate(isEsm: boolean): string {
return `import { AppDataSource } from '../data-source'
return `import { AppDataSource } from "../data-source${
isEsm ? ".js" : ""
}"
import { NextFunction, Request, Response } from "express"
import { User } from "../entity/User${isEsm ? ".js" : ""}"
Expand Down

0 comments on commit 5be20e2

Please sign in to comment.