Hey Folks, is the SST equivalent of the following...
# help
a
Hey Folks, is the SST equivalent of the following command :
Copy code
$ serverless invoke local --function get --path mocks/get-event.json
to mock the API URL provided by the SST output via Postman?
f
Yeah that works.
We are going to provide a way to invoke a function through CLI with mocked event
But for now, using Postman, or invoking the Lambda through AWS Lambda console also works
a
Shot for getting back to me. 🎯Do you think it would be worthwhile having it in the docs? [keen to open a PR] Because it was a small blocker for me, till I put 2 and 2 together. 😅
Unless its mentioned elsewhere? glitch crab
t
Small thing but important to be aware of the difference, the API construct is creating an api gateway in aws and mapping certain routes to certain functions. When you hit the endpoint with postman or curl or the browser you are going through API gateway which is then invoking your function
That's different than invoking the function directly with your own event, which is what that serverless snippet above is doing
a
Thanks for pointing that out. 🙌
f
Amo, adding it to the doc would be great. @Jay where should the doc for this go? https://docs.serverless-stack.com/working-locally or https://docs.serverless-stack.com/migrating-from-serverless-framework?
j
Yeah might be better to expand on this section https://docs.serverless-stack.com/migrating-from-serverless-framework#workflow. @Amo Moloko if you can add something there I can take a look and merge it.