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

[Question/feature request] Run static website without having to put each file after bucket creation #617

Open
scooper91 opened this issue Apr 22, 2020 · 1 comment

Comments

@scooper91
Copy link

scooper91 commented Apr 22, 2020

I'm trying to get a static site working using the s3rver CLI. Ideally, I want to point s3rver to a folder containing the source and the website configuration, and it to serve the documents correctly.

It's currently 404ing trying to retrieve index.html because the html files are not being added into the actual bucket.

Current code:

s3rver -d /website -a 0.0.0.0 --configure-bucket website.local /website/website-configuration.xml

Where /website contains the html files.

Output of lsing the directories (for reference, this is running in Docker):

/website # ls -la
total 24
drwxr-xr-x    3 root     root          4096 Apr 22 14:19 .
drwxr-xr-x    1 root     root          4096 Apr 22 14:19 ..
-rw-r--r--    1 root     root            85 Apr 22 14:19 error.html
-rw-r--r--    1 root     root            78 Apr 22 14:19 index.html
-rw-r--r--    1 1001     1001           243 Apr 22 13:58 website-configuration.xml
drwxr-xr-x    2 root     root          4096 Apr 22 14:19 website.local
/website # ls -la website.local/
total 12
drwxr-xr-x    2 root     root          4096 Apr 22 14:19 .
drwxr-xr-x    3 root     root          4096 Apr 22 14:19 ..
-rw-r--r--    1 root     root           227 Apr 22 14:19 ._S3rver_website.xml

Is it possible to do this? Looking at the tests, you seem to have to create the bucket first, and then add the html files like you would add to a normal bucket.

Thanks!

@scooper91 scooper91 changed the title [Qustion [Question/feature request] Run static website without having to put each file after bucket creation Apr 22, 2020
@kherock
Copy link
Collaborator

kherock commented Jun 4, 2020

Hi @scooper91! This question actually does come up a lot, I'm currently putting together some "getting started" guides that will include examples for scenarios like this.

Your best bet is to use the AWS CLI to copy your files in with aws --endpoint-url http://localhost:4568 s3 sync. You can use a simple file watcher setup to do this pretty efficiently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants