Clean custom-routes example

This commit is contained in:
Sébastien Chopin 2016-11-27 18:12:45 +01:00
parent cbba9d0631
commit 6ab9f138c4

View File

@ -1,11 +1,4 @@
const axios = require('axios')
module.exports = { module.exports = {
env: {
token: 'Hello :)',
num: 3,
bool: true
},
router: { router: {
routes: [ routes: [
{ name: 'user', path: '/users/:id(\\d+)', component: 'pages/_user' } { name: 'user', path: '/users/:id(\\d+)', component: 'pages/_user' }
@ -13,17 +6,5 @@ module.exports = {
}, },
build: { build: {
vendor: ['axios'] vendor: ['axios']
},
generate: {
routeParams: {
'/users/:id(\\d+)': function () {
return axios.get('http://jsonplaceholder.typicode.com/users')
.then((res) => {
return res.data.map((user) => {
return { id: user.id }
})
})
}
}
} }
} }