Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sam local start-api cannot be accessed from outside

I am using aws sam local to developer few lambdas/nanoservices

I start the lambda container with:

sudo sam local start-api --docker-network db-pros

where db-pros is the database container

when I go to 127.0.0.1:3000/lambda-name everything works fine however when I try to connect from the test device (Android phone which is connected to WiFi) I cannot.

Tried to use the IP (both Ethernet and docker0) from ifconfig and I still can't connect.

I do not know if it's possible and if yes how.

like image 719
user93466 Avatar asked Jan 25 '26 14:01

user93466


1 Answers

Use sam local start-api --host 0.0.0.0 instead.

like image 125
skylr lu Avatar answered Jan 27 '26 02:01

skylr lu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!