Comments (9)
on a flight today but have this in my queue!
from functions.
oh! good call. I wonder… you still might want the s3 url behavior in some cases. maybe we add arc.http.helpers._static
for the _static URLs ?
from functions.
Hrm a static and a _static seems a bit obscure. Maybe something more explicit if both are needed?
from functions.
yeah…its weird! what would u suggest ?
from functions.
OK so I've read https://github.com/arc-repos/architect/blob/master/changelog.md and the updated https://arc.codes/guides/static-assets and I'm still not totally clear.
I gather:
- We can access blobs in S3 buckets directly using _static (new in Arc 5.5)
- We can access S3 through lambda (which is what Arc 5.0 did)
Is that correct?
In what circumstances would we need the older behavior?
The changelog should also have advice on what to change during the upgrade for static assets to keep working. Maybe we need to move files, maybe we need to call static()
differently, I'm not sure.
from functions.
Yo! Ya this is a bit confusing sorry! I'll try to explain.
The root S3 proxy (using arc.proxy.public
) and the 'extra' /_static
proxy can only handle text content currently (a limitation of API Gateway). So you'll still probably want to load binary content like images, videos, fonts, etc from S3 using the direct S3 URLs.
For text content (json, html, js, css, etc) you will probably want to use either proxy because now your static assets are on the same origin as your dynamic routes and thusly more secured (without CORs). The root proxy passes through Lambda so you get more power BUT that comes at the cost of a Lambda execution so we were motivated to add /_static
fallback for devs that want to avoid the Lambda execution but still have the benefits of a same origin.
from functions.
Hey @brianleroux I'm a little stuck on this one (trying to update arc-example-ws
so it works on current code).
I appreciate the detailed answer, but I'm getting lost here. It seems like a really simple problem. https://arc.codes/guides/static-assets does not help as it is out of date:
- I am on the sandbox.
- I have a client side JS file
let clientSideJS = static('/index.mjs')
returns a broken URL/index.mjs
let clientSideJS = '/_static/index.mjs'
works fine,
What is the correct way to refer to a JS file in public
so that it will work on sandbox, staging, production, etc?
I can update the docs accordingly if you need.
from functions.
Still occurs on @architect/architect 5.6.3 + @architect/functions 3.0.1
from functions.
should be fixed in latest!
from functions.
Related Issues (20)
- Proxy static deployment issues
- Build backwards compat for `multiValueHeaders` and `multiValueQueryStringParameters`?
- Rate exceeded doing SNS scans in events.publish
- arc.http.express does not correctly resolve the request method HOT 1
- arc.tables indexes HOT 2
- Changing the value of NODE_ENV can break builds HOT 4
- Deploy failed after following quickstart HOT 5
- Feature suggestion for full static manifest output HOT 2
- Improve handling of body parsing errors
- Before erroring out due to a missing entry in the service map, run service discovery once
- Publish to sandbox queue reads events port from wrong property HOT 2
- brotli compression breaks Sandbox livereload HOT 1
- dtslint it pinned, either rework TS lint step or scrap it
- A couple type defs missing for aliases HOT 1
- Arc deploy failing with AWS CICD
- Static does not work with fingerprinting HOT 2
- Type definition for tables()._db, tables()._doc is wrong for nodejs18.x runtime HOT 10
- Allow passing translateConfig to Dynamo client and doc client HOT 8
- Add option to enable/disable brotli compression
- JWE secret is not correctly passed for encryption
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functions.