A sample lambda is created when enabling cloud-api
jarrettj opened this issue · 1 comments
jarrettj commented
Hi,
Good day.
Why is a sampleCloudApi function created? Can it be renamed? And if it is removed it still stays in the folder.
$ awsmobile cloud-api enable
Adding lambda function code on
/Users/thejj/work/angular/projects/testing/awsmobilejs/backend/cloud-api/sampleLambda/
...
To test the api from the command line (after awsmobile push) use this commands
awsmobile cloud-api invoke sampleCloudApi <method> /items [init]
Regards.
elorzafe commented
Hi,
When you enable cloud-api on your project like you did. awsmobile-cli
creates a sample function so you can test your api against that function. Is an starting point to create your own functions on serverless express.
awsmobile-cli
is not removing the folder in purpose so wont lose your code accidentally.
If you run awsmobile cloud-api enable -p
(if you dont have that feature enabled) or awsmobile cloud-api configure
(in case you have and select create new api) you can configure the function name that will create a directory with the same name.