Skip to content

Commit 368ccc6

Browse files
committed
Support simplified service url ENV format
Fixes #12069
1 parent e2fe68d commit 368ccc6

File tree

15 files changed

+177
-66
lines changed

15 files changed

+177
-66
lines changed

playground/AspireWithJavaScript/AspireJavaScript.Angular/default.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ server {
1111
}
1212

1313
location /api/ {
14-
proxy_pass ${services__weatherapi__https__0};
14+
proxy_pass ${WEATHERAPI_HTTPS};
1515
proxy_http_version 1.1;
1616
proxy_ssl_server_name on;
1717
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

playground/AspireWithJavaScript/AspireJavaScript.Angular/proxy.conf.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module.exports = {
22
"/api": {
33
target:
4-
process.env["services__weatherapi__https__0"] ||
5-
process.env["services__weatherapi__http__0"],
4+
process.env["WEATHERAPI_HTTPS"] || process.env["WEATHERAPI_HTTP"],
65
secure: process.env["NODE_ENV"] !== "development",
76
pathRewrite: {
87
"^/api": "",

playground/AspireWithJavaScript/AspireJavaScript.React/default.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ server {
1111
}
1212

1313
location /api/ {
14-
proxy_pass ${services__weatherapi__https__0};
14+
proxy_pass ${WEATHERAPI_HTTPS};
1515
proxy_http_version 1.1;
1616
proxy_ssl_server_name on;
1717
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

playground/AspireWithJavaScript/AspireJavaScript.React/webpack.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ module.exports = (env) => {
1010
{
1111
context: ["/api"],
1212
target:
13-
process.env.services__weatherapi__https__0 ||
14-
process.env.services__weatherapi__http__0,
13+
process.env.WEATHERAPI_HTTPS || process.env.WEATHERAPI_HTTP,
1514
pathRewrite: { "^/api": "" },
1615
secure: false,
1716
},

playground/AspireWithJavaScript/AspireJavaScript.Vite/default.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ server {
1111
}
1212

1313
location /api/ {
14-
proxy_pass ${services__weatherapi__https__0};
14+
proxy_pass ${WEATHERAPI_HTTPS};
1515
proxy_http_version 1.1;
1616
proxy_ssl_server_name on;
1717
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

playground/AspireWithJavaScript/AspireJavaScript.Vite/vite.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ export default defineConfig(({ mode }) => {
1111
port: parseInt(env.VITE_PORT),
1212
proxy: {
1313
'/api': {
14-
target: process.env.services__weatherapi__https__0 ||
15-
process.env.services__weatherapi__http__0,
14+
target: process.env.WEATHERAPI_HTTPS || process.env.WEATHERAPI_HTTP,
1615
changeOrigin: true,
1716
rewrite: (path) => path.replace(/^\/api/, ''),
1817
secure: false,

playground/AspireWithJavaScript/AspireJavaScript.Vue/default.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ server {
1111
}
1212

1313
location /api/ {
14-
proxy_pass ${services__weatherapi__https__0};
14+
proxy_pass ${WEATHERAPI_HTTPS};
1515
proxy_http_version 1.1;
1616
proxy_ssl_server_name on;
1717
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

playground/AspireWithJavaScript/AspireJavaScript.Vue/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default defineConfig({
1818
port: parseInt(process.env.PORT ?? "5173"),
1919
proxy: {
2020
'/api': {
21-
target: process.env.services__weatherapi__https__0 || process.env.services__weatherapi__http__0,
21+
target: process.env.WEATHERAPI_HTTPS || process.env.WEATHERAPI_HTTP,
2222
changeOrigin: true,
2323
rewrite: path => path.replace(/^\/api/, ''),
2424
secure: false

playground/AspireWithNode/AspireWithNode.AppHost/AppHost.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
.AddRedis("cache")
99
.WithPassword(pass);
1010

11-
var weatherapi = builder.AddProject<Projects.AspireWithNode_AspNetCoreApi>("weatherapi");
11+
var weatherapi = builder.AddProject<Projects.AspireWithNode_AspNetCoreApi>("weatherapi")
12+
.WithHttpsEndpoint(port: 9999, name: "dashboard"); ;
1213

1314
var frontend = builder.AddNpmApp("frontend", "../NodeFrontend", "watch")
1415
.WithReference(weatherapi)

playground/AspireWithNode/NodeFrontend/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const config = {
1515
certFile: process.env['HTTPS_CERT_FILE'] ?? '',
1616
certKeyFile: process.env['HTTPS_CERT_KEY_FILE'] ?? '',
1717
cacheUrl: process.env['CACHE_URI'] ?? '',
18-
apiServer: process.env['services__weatherapi__https__0'] ?? process.env['services__weatherapi__http__0']
18+
apiServer: process.env['WEATHERAPI_HTTPS'] ?? process.env['WEATHERAPI_HTTP']
1919
};
2020
console.log(`config: ${JSON.stringify(config)}`);
2121

0 commit comments

Comments
 (0)