Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gateway: routable static base path #3006

Merged
merged 3 commits into from May 14, 2024
Merged

gateway: routable static base path #3006

merged 3 commits into from May 14, 2024

Conversation

mikecutalo
Copy link
Contributor

@mikecutalo mikecutalo commented May 13, 2024

Description

When this option is enable, you will be able to utilize the /static route in your application. Currently any request to the /static path will assume you are looking for a static FE asset.

To enable:

gateway:
  assets:
    routableStaticPath: true

Testing Performed

Unit / Local.

Enabled:

~ curl localhost:8080/static
{"code":5, "message":"Not Found", "details":[]}%

➜  ~ curl localhost:8080/static/js/main.25b2e9af.js
/*! For license information please see main.25b2e9af.js.LICENSE.txt */
(()=>{var __webpack_modules__={67027:e=>{e.exports={"@clutch-sh/ec2" ...

Disabled (default)

~ curl localhost:8080/static -Lv
*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET /static HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.4.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Location: static/
< Date: Tue, 14 May 2024 15:12:30 GMT
< Content-Length: 0
<
* Connection #0 to host localhost left intact
* Issue another request to this URL: 'http://localhost:8080/static/'
* Found bundle for host: 0x60000353c3c0 [serially]
* Can not multiplex, even if we wanted to
* Re-using existing connection with host localhost
> GET /static/ HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.4.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/html; charset=utf-8
< Last-Modified: Mon, 13 May 2024 20:44:49 GMT
< Date: Tue, 14 May 2024 15:12:30 GMT
< Content-Length: 59
<
<pre>
<a href="css/">css/</a>
<a href="js/">js/</a>
</pre>
* Connection #0 to host localhost left intact~ curl localhost:8080/static/js/main.25b2e9af.js
/*! For license information please see main.25b2e9af.js.LICENSE.txt */
(()=>{var __webpack_modules__={67027:e=>{e.exports={"@clutch-sh/ec2" ...

@mikecutalo mikecutalo force-pushed the gateway-static-route branch 2 times, most recently from ee5a9eb to 2a18a4f Compare May 13, 2024 21:13
@mikecutalo mikecutalo changed the title static route gateway: routable static base path May 13, 2024
@mikecutalo mikecutalo marked this pull request as ready for review May 13, 2024 22:48
@mikecutalo mikecutalo requested a review from a team as a code owner May 13, 2024 22:48
Copy link
Contributor

@jdslaugh jdslaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@mikecutalo mikecutalo merged commit 7fdec3d into main May 14, 2024
14 checks passed
@mikecutalo mikecutalo deleted the gateway-static-route branch May 14, 2024 16:59
mikecutalo added a commit that referenced this pull request May 14, 2024
mikecutalo added a commit that referenced this pull request May 14, 2024
mikecutalo added a commit that referenced this pull request May 14, 2024
mikecutalo added a commit that referenced this pull request May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants