Mcgurk-Adam / adammcgurk.com

This holds all of the front end magic for adammcgurk.com
0 stars 0 forks source link

Test AWS locally blog post #22

Open Mcgurk-Adam opened 2 years ago

Mcgurk-Adam commented 2 years ago

I need a blog post about how you test AWS locally without all the hoopla:

node -e "require('./index').handler(require('./event.json'));"

It would also be nice to init env variables that way too

Mcgurk-Adam commented 2 years ago

Put this in the package.json:

  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "bootstrap-env": "export $(cat .env | xargs)",
    "lambda-call": "node -e \"require('./index').handler(require('./event.json'));\"",
    "locally": "npm run bootstrap-env & npm run lambda-call"
  },