File tree 2 files changed +50
-1
lines changed
2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Doc: https://www.netlify.com/docs/netlify-toml-reference/
1
2
[build ]
2
- command = " yarn generate"
3
+ command = " yarn build"
4
+ functions = " lambdas-dist"
3
5
publish = " dist"
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <h2 >Hello, World!</h2 >
4
+ <b-btn variant =" primary" @click =" helloWorld()" >Hello</b-btn >
5
+ <p >Response: {{ response }}</p >
6
+ <p v-if =" error" >
7
+ <strong >Error {{ error.status }}</strong >
8
+ <br />
9
+ {{ error.data }}
10
+ </p >
11
+ </div >
12
+ </template >
13
+
14
+ <script >
15
+ export default {
16
+ head () {
17
+ return {
18
+ title: ' Nuxt Netlify Lambda - Home' ,
19
+ meta: [
20
+ {
21
+ hid: ' description' ,
22
+ name: ' description' ,
23
+ content: ' Nuxt Netlify Lambda Home description'
24
+ }
25
+ ]
26
+ }
27
+ },
28
+ data () {
29
+ return {
30
+ response: ' —' ,
31
+ error: null
32
+ }
33
+ },
34
+ methods: {
35
+ async helloWorld () {
36
+ try {
37
+ const res = await this .$axios .$get (' /.netlify/functions/hello' )
38
+ this .response = res
39
+ this .error = null
40
+ } catch (e) {
41
+ this .error = e .response
42
+ this .response = ' —'
43
+ }
44
+ }
45
+ }
46
+ }
47
+ </script >
You can’t perform that action at this time.
0 commit comments