import Nav from '~/components/Nav.vue'
import axios from 'axios'
export default {
components: {
Nav
},
data ()
{
return {
pastes: []
}
},
/**
* Fetch the ids of pastes before rendering
* the component
*/
async asyncData({ params })
{
let uri = `https://us-central1-tabbit-1313.cloudfunctions.net/recent`
let { data } = await axios.get(uri)
// Set state.pastes
return { pastes: data.payload }
}
}