From 014fe8b47ce878671712512261ab4b8762cee73f Mon Sep 17 00:00:00 2001 From: David Beale Date: Tue, 5 May 2015 09:14:28 +0100 Subject: [PATCH 1/2] Describe static hosting --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 2b6f743f..52aa986e 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,21 @@ Please see [Fake S3s wiki page](https://github.com/jubos/fake-s3/wiki/Supported- Please test, if you encounter any problems please do not hesitate to open an issue :) +## Static Website Hosting + +If you specify an *indexDocument* then ```get``` requests will serve the *indexDocument* if it found, simulating the static website mode of AWS S3. An *errorDocument* can also be set, to serve a custom 404 page. + +### Hostname Resolution + +By default a bucket name needs to be given. So for a bucket called ```mysite.local```, with an indexDocument of ```index.html```. Visiting ```http://localhost:4568/mysite.local/``` in your browser will display the ```index.html``` file uploaded to the bucket. + +However you can also setup a local hostname in your /etc/hosts file pointing at 127.0.0.1 +``` +localhost 127.0.0.1 +mysite.local 127.0.0.1 +``` +Now you can access the served content at ```http://mysite.local:4568/``` + ## Tests > When running the tests with node v0.10.0 the following [error](https://github.com/mochajs/mocha/issues/777) is encountered. This is resolved by running the tests with v0.11.*. I recommend using [NVM](https://github.com/creationix/nvm) to manage your node versions. From 90d706465f68a87b344f5b42b62860d5ad7b5ff5 Mon Sep 17 00:00:00 2001 From: David Beale Date: Tue, 5 May 2015 09:15:03 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 52aa986e..5606cf3c 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Please test, if you encounter any problems please do not hesitate to open an iss ## Static Website Hosting -If you specify an *indexDocument* then ```get``` requests will serve the *indexDocument* if it found, simulating the static website mode of AWS S3. An *errorDocument* can also be set, to serve a custom 404 page. +If you specify an *indexDocument* then ```get``` requests will serve the *indexDocument* if it is found, simulating the static website mode of AWS S3. An *errorDocument* can also be set, to serve a custom 404 page. ### Hostname Resolution