aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

[Proposal / RFC] Implementing a custom mount point for static files

Open randallb opened this issue 1 year ago • 2 comments

I'd like to ideally mount my static files at another spot other than "/" since this conflicts with catchall routes, which I currently use for my application extensively.

I'm proposing adding an optional parameter here: https://github.com/aws/aws-sam-cli/blob/870c547f210b9dbd93abf75e7a0a1ec9b292c50b/samcli/local/apigw/local_apigw_service.py#L61

plumbing it up through here: https://github.com/aws/aws-sam-cli/blob/870c547f210b9dbd93abf75e7a0a1ec9b292c50b/samcli/commands/local/lib/local_api_service.py#L57

all the way up to the root of the CLI, where I'd add a flag: --static-route-base

Is this reasonable? I'm happy to implement myself, but wanted to check if that was something you all would appreciate as a community contribution.

There are several issues relating to this problem (though indirectly, sometimes failing on root path, etc.)

Would love to fix this, pls lmk.

Thanks for SAM! I use it in conjunction with CDK daily, and it's really helpful.

randallb avatar Dec 01 '23 19:12 randallb

Thanks for opening this issue! We welcome contributions from community members, but if you had wanted some confirmation from team I can look at getting that for you. The request sounds reasonable enough to me (not mounting files at /), but let me check in with the team in case they had more ideas on how to go about adding a new option.

lucashuy avatar Dec 01 '23 23:12 lucashuy

Thanks for the wait, the team doesn't have any concerns about this request and welcome any contributions to this feature. If there are any discussions, feel free to leave them here, or when a PR gets made, the team can discuss implementation details in there.

lucashuy avatar Dec 04 '23 19:12 lucashuy