Skip to content

Instantly share code, notes, and snippets.

@jesperlandberg
Last active October 24, 2017 07:05
Show Gist options
  • Save jesperlandberg/9dd4b7a463f6c0001527abb9a514537e to your computer and use it in GitHub Desktop.
Save jesperlandberg/9dd4b7a463f6c0001527abb9a514537e to your computer and use it in GitHub Desktop.
nuxt.config.js
const axios = require('axios')
module.exports = {
generate: {
routes: function () {
return axios.get('http://exmaple.com/api/cases')
.then((res) => {
return res.data.objects.map((content) => {
return {
route: '/case/' + content.slug,
payload: content
}
})
})
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment