Amar Pathak
Amar Pathak

Reputation: 130

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

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

Upvotes: 3

Views: 378

Answers (1)

Edward
Edward

Reputation: 736

You can try:

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

This will export the variables from the .env file .

Upvotes: 4

Related Questions