Last active
October 24, 2017 07:05
-
-
Save jesperlandberg/9dd4b7a463f6c0001527abb9a514537e to your computer and use it in GitHub Desktop.
nuxt.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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