winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
5.02k stars 197 forks source link

Adding a reverse proxy wing resource #3196

Open tsuf239 opened 1 year ago

tsuf239 commented 1 year ago

Feature Spec

Creating a proxy wing resource that will simplify the following code: https://github.com/winglang/website-proxy could be helpful

@ainvoner FYI

Use Cases

gathering a few different domains to be under a single domain

Implementation Notes

We should probably write a blog post after achieving that easily on wing :)

Component

SDK

Community Notes

staycoolcall911 commented 1 year ago

CC: @skorfmann

skorfmann commented 1 year ago

Yes, here are a few thoughts:

skorfmann commented 1 year ago

Besides from that, adding a proxy feature to the Website resource might also be nice.

rather than

let website = new cloud.Website(
  path: "./static",
);

let api = new cloud.Api();
// somehow inject the URL as config (and having to deal with CORS for the API)
website.addJson("config.json", { api: api.url });

something like

let website = new cloud.Website(
  path: "./static",
);

let api = new cloud.Api();
// define a known path with no CORS headaches
website.proxy("/myapi", api.url)

This stems from this example

github-actions[bot] commented 1 year ago

Hi,

This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

skyrpex commented 11 months ago

Totally agree with Sebastian: allowing to define proxies in the website resource directly would be awesome.

Not sure what elements can be used to provide the same functionality in the cloud providers than aws, though.

github-actions[bot] commented 7 months ago

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

github-actions[bot] commented 4 months ago

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!