where the TEMPLATE_NAME
is any of the templates available in the template repo. You can also list the available templates by calling twilio serverless:list-templates
or npx twilio-run list-templates
.
To add a template function to your existing Twilio Functions project you can run twilio serverless:new
or npx twilio-run new
and the command will walk you through choosing a template.
If you have built a function that you think would be useful for others you can propose it to the repo by opening a pull request on GitHub.
3. Change the deploy directory
By default a Serverless Toolkit project has a functions
and an assets
directory. This may not reflect the application you are building though. If, for example, you are building a front-end application that needs bundling or compiling, like a React or Angular application, your assets may end up in a dist
or build
directory.
When you run or deploy your application, you don't want to have to change that directory into an assets
directory. Instead, the Serverless Toolkit makes it easy to change the directory from which you run and deploy your functions and assets. If you want to run your application where assets are in a dist
directory and your functions are in a src
directory you can run: