Skip to content

Commit 4ee3429

Browse files
committed
fix(cli): move sequence customization to app constructor
1 parent c1d7a52 commit 4ee3429

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/cli/generators/app/templates/src/application.ts.ejs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import {BootMixin, Booter, Binding} from '@loopback/boot';
1010
export class <%= project.applicationName %> extends BootMixin(RestApplication) {
1111
constructor(options?: ApplicationConfig) {
1212
super(options);
13+
14+
// Set up the custom sequence
15+
this.sequence(MySequence);
16+
1317
this.projectRoot = __dirname;
1418
// Customize @loopback/boot Booter Conventions here
1519
this.bootOptions = {
@@ -23,12 +27,9 @@ export class <%= project.applicationName %> extends BootMixin(RestApplication) {
2327
}
2428

2529
async start() {
26-
const server = await this.getServer(RestServer);
27-
// Set up the custom sequence
28-
server.sequence(MySequence);
29-
3030
await super.start();
3131

32+
const server = await this.getServer(RestServer);
3233
const port = await server.get('rest.port');
3334
console.log(`Server is running at http://127.0.0.1:${port}`);
3435
console.log(`Try http://127.0.0.1:${port}/ping`);

0 commit comments

Comments
 (0)