GithubHelp home page GithubHelp logo

Support for serving static files about aws-sam-cli HOT 6 CLOSED

aws avatar aws commented on September 24, 2024 2
Support for serving static files

from aws-sam-cli.

Comments (6)

PaulMaddox avatar PaulMaddox commented on September 24, 2024

Should be quick to add.

https://github.com/gorilla/mux#static-files

from aws-sam-cli.

PaulMaddox avatar PaulMaddox commented on September 24, 2024

I think it makes more sense to default the public/ for the --public-dir.

Two reasons:

  1. The AWS CodeStar Node.JS Serverless project uses public/, so this would work out of the box - great for new customers and demos.

  2. 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.

sanathkr avatar sanathkr commented on September 24, 2024

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.

PaulMaddox avatar PaulMaddox commented on September 24, 2024

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.

sanathkr avatar sanathkr commented on September 24, 2024

Sounds good.

from aws-sam-cli.

turjachaudhuri avatar turjachaudhuri commented on September 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.