Skip to content

Commit

Permalink
Add lifecycle hook for serverless offline start
Browse files Browse the repository at this point in the history
Serverless offline has 2 root commands to start : 
- `serverless offline` which triggers `offline:start` life cycle hook (This is working)
- `serverless offline start` which triggers `offline:start:init` and  `offline:start:end` life cycle hooks (This is NOT working)

The second one is important, because it has an event on start up and on end.
If you want to work with serverless-offline, serverless-webpack and serverless-dynamodb-local. You need to call `sls offline start` which will also stop the db and stop serverless offline
  • Loading branch information
Gregoirevda authored Jun 9, 2017
1 parent fa63795 commit 78c67ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ class ServerlessWebpack {
'before:offline:start': () => BbPromise.bind(this)
.then(this.validate)
.then(this.wpwatch),

'before:offline:start:init': () => BbPromise.bind(this)
.then(this.validate)
.then(this.wpwatch),

};
}
}
Expand Down

0 comments on commit 78c67ed

Please sign in to comment.