Skip to content

Commit 3e267c4

Browse files
author
aligneddev
committed
hmr on port 5173??
1 parent 276f8eb commit 3e267c4

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/BikeTracking.AppHost/AppHost.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515

1616
var webFrontend = builder
1717
.AddViteApp("frontend", "../BikeTracking.Frontend")
18+
.WithEndpoint(
19+
"http",
20+
endpoint =>
21+
{
22+
endpoint.Port = 5173;
23+
endpoint.TargetPort = 5173;
24+
// Disabling the proxy means Aspire's dashboard will not track requests for the frontend application, and you must ensure the configured port (default 5173) does not conflict with other local Vite instances
25+
// Required for HMR to work with default Aspire proxy
26+
endpoint.IsProxied = false;
27+
}
28+
)
1829
.WithReference(apiService)
1930
.WaitFor(apiService);
2031

src/BikeTracking.Frontend/src/pages/HistoryPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function HistoryTable({
5959
<table className="history-page-table" aria-label="Ride history table">
6060
<thead>
6161
<tr>
62-
<th scope="col">Date</th>
62+
<th scope="col">Dateddddd</th>
6363
<th scope="col">Miles</th>
6464
<th scope="col">Duration</th>
6565
<th scope="col">Temperature</th>

src/BikeTracking.Frontend/vite.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ import react from "@vitejs/plugin-react";
44
// https://vite.dev/config/
55
export default defineConfig({
66
server: {
7+
host: true,
78
open: !process.env.CI,
8-
port: 49363,
9+
port: 5173,
10+
hmr: {
11+
overlay: true, // Show error overlay
12+
},
913
},
1014
plugins: [react()],
1115

0 commit comments

Comments
 (0)