OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to expose port 3030 in AWS container website?

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Guest
I have a react project which includes a 'server.js' file which I am going to use to make data requests with important security secrets, at the moment I'm trying to make it work with simple string responses. enter image description here When I run both npm start and node src/server/server.js locally, it works great, clicking the 'fetch data' react button makes a request to localhost:3030 (where the server is running) and displays the result. enter image description here

When I try the same thing on my amazon web service container website, it fails, saying that it failed trying to fetch localhost:3030

enter image description here

How do I fix this so that in my live production AWS instance, I can make api requests to my server.js file ? My code is here: https://github.com/MartinBarker/aws-react-docker-ghactions

And was built by following this guide on aws container web setup for creating the task / service rules. https://medium.com/@nwosuonyedikach...p-to-aws-ecs-with-github-actions-5c74c1869800
<p>I have a react project which includes a 'server.js' file which I am going to use to make data requests with important security secrets, at the moment I'm trying to make it work with simple string responses.
<a href="https://i.sstatic.net/itkTJbtj.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/itkTJbtj.png" alt="enter image description here" /></a>
When I run both <code>npm start</code> and <code>node src/server/server.js</code> locally, it works great, clicking the 'fetch data' react button makes a request to localhost:3030 (where the server is running) and displays the result.
<a href="https://i.sstatic.net/7NghCieK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7NghCieK.png" alt="enter image description here" /></a></p>
<p>When I try the same thing on my amazon web service container website, it fails, saying that it failed trying to fetch localhost:3030</p>
<p><a href="https://i.sstatic.net/LhShLrHd.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LhShLrHd.png" alt="enter image description here" /></a></p>
<p>How do I fix this so that in my live production AWS instance, I can make api requests to my server.js file ? My code is here:
<a href="https://github.com/MartinBarker/aws-react-docker-ghactions" rel="nofollow noreferrer">https://github.com/MartinBarker/aws-react-docker-ghactions</a></p>
<p>And was built by following this guide on aws container web setup for creating the task / service rules.
<a href="https://medium.com/@nwosuonyedikach...p-to-aws-ecs-with-github-actions-5c74c1869800" rel="nofollow noreferrer">https://medium.com/@nwosuonyedikach...p-to-aws-ecs-with-github-actions-5c74c1869800</a></p>
Continue reading...
 

Latest posts

Top