0

I am trying to host my static application on aws s3 bucket. I have put my build folder files in bucket. It looks like this

enter image description here

But when I go to .s3-website..amazonaws.com index.jade gets downloaded instead of webapp getting opened.

I followed this tutorial https://www.fullstackreact.com/articles/deploying-a-react-app-to-s3/

How can I get my web app work?

Update:

When I changed content type of index.jade to text/html, the browser shows html text like this

enter image description here

Here is how I edit metadata key in aws console

enter image description here now there is no download. But still web page is not getting served.

EdG
  • 2,243
  • 6
  • 48
  • 103

1 Answers1

0

You need to enable static site hosting on your S3 bucket. To enable website hosting for an Amazon S3 bucket

  1. Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.

  2. In the list, choose the bucket that you want to use for your hosted website.

  3. Choose the Properties tab.

  4. Choose Static website hosting, and then choose Use this bucket to host a website.

  5. You are prompted to provide the index document and any optional error documents and redirection rules that are needed.

Make sure to keep your bucket ACL as public. Also you need to parse your jade files to html.

anshuraj
  • 332
  • 1
  • 5
  • 16