alvarcarto / url-to-pdf-api

Web page PDF/PNG rendering done right. Self-hosted service for rendering receipts, invoices, or any content.
MIT License
7.01k stars 774 forks source link

options in .env not used #19

Closed wtrdk closed 6 years ago

wtrdk commented 6 years ago

When I alter the options in .env they are not used:

export NODE_ENV=development
export PORT=9990
export ALLOW_HTTP=true

When I use them as a prefix for the start command it works just fine:


ALLOW_HTTP=true PORT=9990 npm start

What am I doing wrong?

BTW, very nice piece of software!

Cadiac commented 6 years ago

Did you remember to set the environment variables by running source .env or bash .env after you changed the file?

kimmobrunfeldt commented 6 years ago

Thanks ! 🙇 Advice by @Cadiac should fix the issue. You need to load the .env file each time before starting the server. https://github.com/kennethreitz/autoenv or similar is a good tool to help managing it automatically.