You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 12, 2019. It is now read-only.
Functions that have `node_modules` inside their own folders require these `node_modules` to be installed when deployed. For the time being, the Netlify build process does not recursively install dependencies for your function folders yet. So the recommended way to deploy these functions is to use the CLI command:
204
+
Functions that have `node_modules` inside their own folders require these `node_modules` to be installed when deployed. For the time being, **the Netlify build process does not recursively install dependencies for your function folders yet**. So the recommended way to deploy these functions is to use the CLI command:
205
205
206
206
```
207
207
netlify deploy --prod
208
208
```
209
209
210
-
Opt out of the continuous deployment flow and use [zip-it-and-ship-it](https://github.com/netlify/zip-it-and-ship-it) instead. [Follow this issue for more updates](https://github.com/netlify/netlify-dev-plugin/issues/140).
210
+
Or write a `prebuild` npm script yourself to `cd` into your function folders and install them yourself. We are hoping to improve this flow in future, [follow this issue for more updates](https://github.com/netlify/netlify-dev-plugin/issues/140).
211
211
212
212
**Writing your own Function Templates**
213
213
@@ -232,6 +232,34 @@ Instead of using our basic templates, you can use your own by passing it with a
232
232
233
233
</details>
234
234
235
+
### Locally Testing Functions with `netlify functions:invoke`
236
+
237
+
`netlify functions:invoke` allows you to locally test functions going above and beyond a simple GET request in browser. (we only model POSTs now but could easily expand from here).
238
+
239
+
If you have Netlify Dev running your functions, you can then test sending payloads of data, or authentication payloads:
240
+
241
+
```bash
242
+
243
+
# with prompting
244
+
netlify functions:invoke # we will prompt you at each step
245
+
netlify functions:invoke myfunction # invoke a specific function
246
+
netlify functions:invoke --name myfunction # invoke a specific function
247
+
248
+
# no prompting (good for CI)
249
+
netlify functions:invoke --name myfunction --identity # invoke a specific function with netlify identity headers
250
+
netlify functions:invoke --name myfunction --no-identity # invoke a specific function without netlify identity headers
There are special cases for [event triggered functions](https://www.netlify.com/docs/functions/?utm_source=blog&utm_medium=netlifydev&utm_campaign=devex#event-triggered-functions) (eg `identity-signup`) which will also give you mock data for testing. This makes manual local testing of event triggered functions possible, which drastically improves the development experience.
259
+
260
+
This is a new feature; ideas and feedback and issues and PR's welcome!
261
+
262
+
235
263
### Function Builders, Function Builder Detection, and Relationship with `netlify-lambda`
236
264
237
265
**Existing users of `netlify-lambda` should have no change to their workflow by switching to `netlify dev`.** One immediate benefit is no need for [proxying](https://github.com/netlify/netlify-lambda#proxying-for-local-development) since Netlify Dev does that for you.
0 commit comments