Skip to content

Instantly share code, notes, and snippets.

@james0r
Created June 5, 2020 19:56
Show Gist options
  • Save james0r/e2ee2015ab14245c9531cfca11599852 to your computer and use it in GitHub Desktop.
Save james0r/e2ee2015ab14245c9531cfca11599852 to your computer and use it in GitHub Desktop.
<script>
export default {
data() {
return {
greeting: null,
name: null
}
},
metaInfo: {
title: 'Hello, world!'
},
mounted() {
if (this.$route.query.name) {
this.name = this.$route.query.name
}
fetch('/.netlify/functions/hello-world?name=' + this.name)
.then(
res => res.json()
)
.then(
res => {
this.greeting = res.message
}
)
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment