File tree Expand file tree Collapse file tree 6 files changed +10
-5
lines changed Expand file tree Collapse file tree 6 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ This project is a Angular (With SSR) + Nestjs monorepo using Nx. It is a full-st
8
8
Feel free to contribute to this project by creating a pull request.
9
9
10
10
- [ ] Check on how to build for bun runtime
11
- - [ ] Pre rendering routes doesn't spin up the server, so the HTTP calls are not working.
11
+ - [x ] Pre rendering routes doesn't spin up the server, so the HTTP calls are not working.
12
12
- Wouraround: Use full api url's (http://localhost:4200/api ) instead of relative url's (/api)
13
13
- And spin up the api before building
14
14
- [ ] Create a material included starter
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ async function bootstrap() {
12
12
const app = await NestFactory . create ( AppModule ) ;
13
13
const globalPrefix = 'api' ;
14
14
app . setGlobalPrefix ( globalPrefix ) ;
15
+ app . enableShutdownHooks ( ) ;
15
16
const port = process . env . PORT || 3000 ;
16
17
await app . listen ( port ) ;
17
18
Logger . log (
18
19
`🚀 Application is running on: http://localhost:${ port } /${ globalPrefix } ` ,
19
20
) ;
20
21
}
21
-
22
22
bootstrap ( ) ;
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ import { BackendTestModule } from '@backend/test';
6
6
controllers : [ ] ,
7
7
} )
8
8
export class AppModule { }
9
-
9
+
Original file line number Diff line number Diff line change @@ -13,5 +13,7 @@ import { derivedAsync } from 'ngxtension/derived-async';
13
13
} )
14
14
export class RootComponent {
15
15
private readonly httpClient = inject ( HttpClient ) ;
16
- movie = derivedAsync ( ( ) => this . httpClient . get ( `/api/backend-test` ) ) ;
16
+ movie = derivedAsync ( ( ) =>
17
+ this . httpClient . get ( `http://localhost:3000/api/backend-test` ) ,
18
+ ) ;
17
19
}
Original file line number Diff line number Diff line change 4
4
"license" : " MIT" ,
5
5
"scripts" : {
6
6
"start" : " nx run-many -t serve -p tag:scope:app" ,
7
- "build" : " nx build"
7
+ "build" : " concurrently \" nx serve api\" \" bun run wait-and-build\" --kill-others --success last --kill-signal SIGINT" ,
8
+ "wait-and-build" : " wait-on tcp:3000 && nx build app"
8
9
},
9
10
"private" : true ,
10
11
"dependencies" : {
66
67
"@types/node" : " 20.12.12" ,
67
68
"@typescript-eslint/eslint-plugin" : " ^7.10.0" ,
68
69
"@typescript-eslint/parser" : " ^7.10.0" ,
70
+ "concurrently" : " ^8.2.2" ,
69
71
"eslint" : " ~9.3.0" ,
70
72
"eslint-config-prettier" : " ^9.1.0" ,
71
73
"eslint-plugin-playwright" : " ^1.6.2" ,
78
80
"ts-jest" : " ^29.1.3" ,
79
81
"ts-node" : " 10.9.2" ,
80
82
"typescript" : " ~5.4.5" ,
83
+ "wait-on" : " ^7.2.0" ,
81
84
"webpack-cli" : " ^5.1.4"
82
85
}
83
86
}
You can’t perform that action at this time.
0 commit comments