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
Copy file name to clipboardExpand all lines: README.md
+10-19Lines changed: 10 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,35 +10,26 @@
10
10
Live demo can be found [here](https://nuxt-netlify-functions-example.netlify.com/).
11
11
12
12
13
-
## Info
14
-
For the requests on the client side we use the [Axios Module](https://github.com/nuxt-community/axios-module). To proxy locally you have to set up the [Proxy Module](https://github.com/nuxt-community/proxy-module) in `nuxt.config.js`:
15
-
16
-
```js
17
-
proxy: {
18
-
'/.netlify': {
19
-
target:'http://localhost:9000',
20
-
pathRewrite: { '^/.netlify/functions':'' }
21
-
}
22
-
}
23
-
```
13
+
## Testing functions locally
14
+
Thanks to the [Netlify Dev](https://www.netlify.com/products/dev/) command in the Netlify CLI (`yarn global add nelitfy-cli`), you can test your functions locally with no build step involved!
15
+
16
+
After building the app and running `netlify dev` or `ntl dev`, you can test the functions locally by hitting the endpoint http://localhost:8888/.netlify/functions/<function-name>
17
+
24
18
25
19
## Build Setup
26
20
27
21
```bash
28
-
# Use nvm
22
+
# Use Node version specified in nvmrc
29
23
$ nvm use
30
24
31
25
# Install dependencies
32
26
$ yarn
33
27
34
-
# Build lambda functions locally
35
-
$ yarn netlify-lambda build netlify-lambda-src
36
-
37
-
# Serve lambda functions locally
38
-
$ yarn netlify-lambda serve netlify-lambda-src
28
+
# Build Nuxt app
29
+
$ yarn build
39
30
40
-
# Serve nuxt app with hot reload at localhost:3000
41
-
$ yarn dev
31
+
# Serve Nuxt app and Netlify functions at localhost:8888
0 commit comments