File tree Expand file tree Collapse file tree 3 files changed +13
-15
lines changed
Expand file tree Collapse file tree 3 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -10,20 +10,20 @@ const isProd = process.env.NODE_ENV === 'production'
1010const buildLocal = process . env . MODE === 'local'
1111
1212// Define DEPLOY_API first
13- const DEPLOY_API = process . env . KAMAL_DEPLOY_HOST
14- ? `https://${ process . env . KAMAL_DEPLOY_HOST } `
13+ const DEPLOY_API = process . env . KAMAL_DEPLOY_HOST
14+ ? `https://${ process . env . KAMAL_DEPLOY_HOST } `
1515 : target
1616
1717// Now use it for API_URL
1818const API_URL = isProd ? DEPLOY_API : ( buildLocal ? '' : target )
1919
2020// Only required if accessing vite directly, e.g. http://localhost:5173
2121const proxy = {
22- '^/api' : {
23- target,
24- secure : false
25- }
22+ '^/api' : {
23+ target,
24+ secure : false
2625 }
26+ }
2727
2828export default defineConfig ( {
2929 define : { apiBaseUrl : `"${ API_URL } "` } ,
@@ -41,6 +41,6 @@ export default defineConfig({
4141 } ,
4242 server : {
4343 host : true , // Listen on all interfaces (both IPv4 and IPv6)
44- proxy,
45- }
44+ proxy,
45+ }
4646} )
Original file line number Diff line number Diff line change 3838services . AddServiceStack ( typeof ( MyServices ) . Assembly ) ;
3939
4040var app = builder . Build ( ) ;
41- var nodeProxy = new NodeProxy ( "http://localhost :5173" ) {
41+ var nodeProxy = new NodeProxy ( "http://127.0.0.1 :5173" ) {
4242 Log = app . Logger
4343} ;
4444
7272// Proxy development HMR WebSocket and fallback routes to the Node server
7373if ( app . Environment . IsDevelopment ( ) )
7474{
75- app . UseWebSockets ( ) ;
76- app . MapViteHmr ( nodeProxy ) ;
77-
7875 // Start the Vite dev server if the lockfile does not exist
7976 app . RunNodeProcess ( nodeProxy ,
8077 lockFile : "../MyApp.Client/dist/lock" ,
8178 workingDirectory : "../MyApp.Client" ) ;
8279
80+ app . UseWebSockets ( ) ;
81+ app . MapViteHmr ( nodeProxy ) ;
8382 app . MapFallbackToNode ( nodeProxy ) ;
8483}
8584else
Original file line number Diff line number Diff line change 2222 "commandName" : " Project" ,
2323 "dotnetRunMessages" : true ,
2424 "launchBrowser" : true ,
25+ "launchUrl" : " " ,
2526 "applicationUrl" : " https://localhost:5001;http://localhost:5000" ,
2627 "environmentVariables" : {
2728 "ASPNETCORE_ENVIRONMENT" : " Development"
3031 "IIS Express" : {
3132 "commandName" : " IISExpress" ,
3233 "launchBrowser" : true ,
33- "launchUrl" : " metadata" ,
3434 "environmentVariables" : {
3535 "ASPNETCORE_ENVIRONMENT" : " Development"
3636 }
3737 }
3838 }
39- }
40-
39+ }
You can’t perform that action at this time.
0 commit comments