Comments (6)
Should be quick to add.
https://github.com/gorilla/mux#static-files
from aws-sam-cli.
I think it makes more sense to default the public/
for the --public-dir
.
Two reasons:
-
The AWS CodeStar Node.JS Serverless project uses
public/
, so this would work out of the box - great for new customers and demos. -
I don't think there would be many instances of people wanting to serve up both their Serverless app (java/node.js source) as well as their static assets, so I don't think that matches what people would deploy to AWS in their Lambda deployment package.
To be clear, we'd mount public/
at /
on the HTTP listener still.
Thoughts?
from aws-sam-cli.
Agree with 1.
Don't agree with 2. If I am building a serverless website, I need to serve static content.
Can we call it --static-dir
instead of public-dir
? It makes the intent more clear. Also can we allow multiple --static-dir
? Frameworks like expressjs allow this. If a file with same name exists in both places, the directory specified first will take precedence. All of them will mount at /
of the HTTP listener.
from aws-sam-cli.
Will make the param --static-dir
, but I don't think the CLI framework we're using allows multiple, so will have to leave that for now.
PR incoming.
from aws-sam-cli.
Sounds good.
from aws-sam-cli.
Sounds good.
Hi Sanath ,
In serverless there are a few custom plugins which help you in uploading a set of files/folders to a s3 bucket as part of the serverless deploy step.
Is there any alternative like that ?
I want to avoid the step of uploading the files manually .
I want to simply create a bucket as part of my SAM template and then upload files from a specific folder in my local directory to the created bucket.
Is this possible?
from aws-sam-cli.
Related Issues (20)
- Sam build with project references in adjacent directory (.NET8 NativeAOT) HOT 4
- `sam sync` with typescript not updating Lambda layer code in Lambda function HOT 5
- Bug: Docker 4.33 + Provided.al2 Image error HOT 9
- Bug: SAM Deployment Issue: Bootstrap File Not Found Despite Successful Build and Upload HOT 1
- Bug: sam pipeline init - ResourceNotFoundException HOT 1
- Bug: Official example for CDK is not working HOT 1
- Bug: Runtime.ImportModuleError for Typescript Lambda function defined using CDK HOT 2
- Feature request: Run Node tests as part of sam build HOT 2
- Bug: sam build --container-env-var is not working HOT 3
- Thumbprint of the AWS SAM Windows MSI installer does not match the documentation HOT 3
- Bug: ResourceDetailedStatus never returns as part of a cloudformation event HOT 3
- Bug: sam build -u stuck on mounting HOT 9
- Bug: sam local invoke HelloWorld lambda times out on Apple M1 Pro after Sonoma upgrade HOT 2
- Bug: sam validate fails for template using 1.122.0 or 1.223.0 HOT 4
- Feature request: Prune Old Versions HOT 2
- Bug: `sam build` Ignores Files in dist/ Directory When Specified in .gitignore HOT 2
- Bug: DBProxyTargetGroup Creation is very slow when using SAM deploy HOT 3
- Bug: sam build - JSONDecodeError HOT 1
- Bug: `sam init` error: "could not clone repo" (non-zero exit status 128) HOT 10
- Bug: parsing Ref in template.json is incorrect HOT 3
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 aws-sam-cli.