Local development with Serverless

Some tips and tricks to help you get started

How do I invoke functions locally?

serverless invoke local -f my-function

How do I test events?

serverless invoke local \
-f video-upload-trigger \
-p tests/fixtures/s3-put-video.json

How do I work with DynamoDB locally?

serverless deploy --stage local
# serverless.ymlprovider:
# ...
stage: ${opt:stage, 'local'} # default to 'local'
TABLE_NAME: my-service-${self:provider.stage}

How do I debug DynamoDB locally?

Entrepreneur tech kid, co-founder of NearSt, Londoner, open source enthusiast and aspiring spare time literature geek.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store