Skip to content

Instantly share code, notes, and snippets.

@DanielKucal
Last active December 24, 2023 05:34
Show Gist options
  • Save DanielKucal/70f7ea97c797181c7a2a31761bcb8081 to your computer and use it in GitHub Desktop.
Save DanielKucal/70f7ea97c797181c7a2a31761bcb8081 to your computer and use it in GitHub Desktop.
Run `sam local start-api` watching for changes in TypeScript source files

Run sam local start-api watching for changes in TypeScript source files

sam build && concurrently "nodemon --on-change-only --ext ts --exec sam build" "sam local start-api"

Requires npm i -g nodemon concurrently

It runs nodemon and sam local start-api in the background simultaneously. The trick is to have the build available before creating docker image, so it's done beforehand and nodemon does it only after changes (using --on-change-only flag).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment