Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run gatsby on a PORT mentioned in a .env file

Tags:

reactjs

gatsby

I am trying to run gatsby on a different port, But the port had to come via .env file.

I tried to put env varibale in commandline

gatsby develop -p process.env.GATSBY_PORT
like image 772
Amar Pathak Avatar asked Dec 13 '25 14:12

Amar Pathak


1 Answers

You can try:

. ./.env && gatsby develop -p $GATSBY_PORT

This will export the variables from the .env file .

like image 139
Edward Avatar answered Dec 15 '25 04:12

Edward



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!