alexnguyennz / astro-aws-amplify

Astro adapter for Astro SSR deployments on AWS Amplify
https://www.astroawsamplify.com
MIT License
31 stars 9 forks source link

load env automatically #20

Closed rishi-raj-jain closed 8 months ago

rishi-raj-jain commented 8 months ago

This PR introduces a way to automatically load the env variables from the AWS AMplify environment before it spins up the server.

The important thing here is to notice that even if someone did the steps of

env >> .env mv .env .amplify-hosting/compute/default/.env

the envs are NOT automatically loaded into the environment by the standalone server created by astro-aws-amplify

Hence, with dotenv, we make sure to load all the envs and make them accessible over import.meta.env and process.env.

rishi-raj-jain commented 8 months ago

wait let me do another PR without prettier