Skip to content

Commit 5be20e2

Browse files
youngkiupleerock
andauthored
fix: express option bug in init command (#10022)
* Fix express option bug in init command * fixed esm support in command * fix linter --------- Co-authored-by: Umed Khudoiberdiev <[email protected]>
1 parent 2a2bb4b commit 5be20e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/commands/InitCommand.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,9 @@ export const Routes = [{
377377
* Gets contents of the user controller file (used when express is enabled).
378378
*/
379379
protected static getControllerTemplate(isEsm: boolean): string {
380-
return `import { AppDataSource } from '../data-source'
380+
return `import { AppDataSource } from "../data-source${
381+
isEsm ? ".js" : ""
382+
}"
381383
import { NextFunction, Request, Response } from "express"
382384
import { User } from "../entity/User${isEsm ? ".js" : ""}"
383385

0 commit comments

Comments
 (0)