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.
Copy file name to clipboardExpand all lines: README.md
+31-16Lines changed: 31 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,10 @@ This is how we pull down your build environment variables and manage your addons
22
22
-`netlify dev:exec <command>` runs a shell command within the netlify dev environment
23
23
-`netlify functions:create` bootstrap a new function
24
24
25
+
<details>
26
+
<summary>
27
+
<b>Pro tip: Aliasing commands</b>
28
+
</summary>
25
29
As these commands are expected to be frequently used, it may be helpful to define aliases in your terminal (Mac: [bash](https://jonsuh.com/blog/bash-command-line-shortcuts/), [zsh](https://askubuntu.com/questions/758496/how-to-make-a-permanent-alias-in-oh-my-zsh), Windows: [doskey](https://stackoverflow.com/questions/20530996/aliases-in-windows-command-prompt), [registry](https://stackoverflow.com/questions/20530996/aliases-in-windows-command-prompt)) to your personal preference. For example:
26
30
27
31
```bash
@@ -33,6 +37,20 @@ alias nfc="netlify functions:create"
33
37
alias ndx="netlify dev:exec "
34
38
```
35
39
40
+
</details>
41
+
42
+
## Live Share
43
+
44
+
To share your ongoing dev session with a coworker, just run Netlify Dev with a `--live` flag:
45
+
46
+
```bash
47
+
netlify dev --live
48
+
```
49
+
50
+
You will get a URL that looks like `https://clever-cray-2aa156-6639f3.netlify.live/`. This can be accessed by anyone as long as you keep your session open.
51
+
52
+
> Note: there are currently known issues with ending the live session alongside your webdevserver, as well as with live reloading. We are working on fixing it, and would appreciate repro cases. In the mean time you can run `ps aux | grep live-tunnel` and kill these sessions manually.
53
+
36
54
## Using the beta
37
55
38
56
Currently the Netlify dev plugin is in private beta. You'll need to follow these steps to enable it:
@@ -137,13 +155,16 @@ Netlify can also create serverless functions for you locally as part of Netlify
137
155
138
156
A number of functiontemplates are available to get you started, and you can add your own utility functions to suit your own project development needs.
139
157
140
-
Create a new function
158
+
**Create a new function**
141
159
142
160
```bash
143
161
$ netlify functions:create
144
162
```
145
163
146
-
More detailed usage examples:
164
+
<details>
165
+
<summary>
166
+
<b>More detailed usage examples</b>
167
+
</summary>
147
168
148
169
```bash
149
170
# Create a new function from one of the
@@ -180,11 +201,15 @@ module.exports = {
180
201
181
202
Instead of using our basic templates, you can use your own by passing it with a --url flag: `netlify functions:create hello-world --url https://github.com/netlify-labs/all-the-functions/tree/master/functions/9-using-middleware`, specifying any addons and postinstall/complete steps as shown above.
182
203
183
-
#### Function Builders, Function Builder Detection, and Relationship with `netlify-lambda`
204
+
</details>
205
+
206
+
### Function Builders, Function Builder Detection, and Relationship with `netlify-lambda`
207
+
208
+
**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.
184
209
185
210
**Why Function Builders**
186
211
187
-
Notice that all the functions created and mentioned so far require no build step. This is intentional: we want to remain agnostic of build tooling and thereby create clear expectations: You give us a folder of functions, and we simply serve it (This is called [`zip-it-and-ship-it`](https://github.com/netlify/zip-it-and-ship-it)). If you want to build that folder from a separate source folder, that is entirely under your control. Use whatever tool you like.
212
+
Notice that all the functions created by `netlify functions:create` require no build step. This is intentional: we want to remain agnostic of build tooling and thereby create clear expectations: You give us a folder of functions, and we simply serve it (This is called [`zip-it-and-ship-it`](https://github.com/netlify/zip-it-and-ship-it)). If you want to build that folder from a separate source folder, that is entirely under your control. Use whatever tool you like.
188
213
189
214
This can be helpful, for example, to use ES modules syntax (e.g. `import`/`export`) via webpack, babel transforms via `babel-cli` or `babel-loader`, or strict type-checking and transpilation with TypeScript's `tsc` or other webpack loaders.
190
215
@@ -202,18 +227,6 @@ Netlify Dev will watch `netlify-lambda`'s source folder and rebuild whenever the
202
227
203
228
We may offer detection formore function buildersin future, and also let you specify functionbuild commands in the `netlify.toml``[dev]` block. Please share your usecase with us if you are likely to need this.
204
229
205
-
## Live Share
206
-
207
-
To share your ongoing dev session with a coworker, just run Netlify Dev with a `--live` flag:
208
-
209
-
```bash
210
-
netlify dev --live
211
-
```
212
-
213
-
You will get a URL that looks like `https://clever-cray-2aa156-6639f3.netlify.live/`. This can be accessed by anyone as long as you keep your session open.
214
-
215
-
> Note: there are currently known issues with ending the live session alongside your webdevserver, as well as with live reloading. We are working on fixing it, and would appreciate repro cases. In the mean time you can run `ps aux | grep live-tunnel` and kill these sessions manually.
216
-
217
230
### Using Add-ons
218
231
219
232
Add-ons are a way for Netlify users to extend the functionality of their Jamstack site/app.
@@ -231,3 +244,5 @@ The above command will install the FaunaDB add-on and provision a noSQL database
231
244
Or install this [one click example](https://github.com/netlify/fauna-one-click).
232
245
233
246
After you have installed an add-on, it will be visible with the `netlify addons:list` command inside your site's current working directory. You can use `netlify addons:delete $ADDONNAME` to delete your addon instance.
247
+
248
+
For now, it is important to include instructions to create addons for each member of your team, as there is no way to specify addons inside of `netlify.toml`. We are working on this.
0 commit comments