UNPKG

nyg-static-jam3

Version:

Jam3 frontend static project scaffold generator based on nyg

29 lines (27 loc) 673 B
import axios from 'axios'; export default { // Include global data here getSiteData: () => ({ title: 'React Static' }), // Include route specific data here getRoutes: async () => { const { data: posts } = await axios.get('https://jsonplaceholder.typicode.com/posts'); return [ { path: '/blog', getData: () => ({ posts }), children: posts.map(post => ({ path: `/post/${post.id}`, component: 'src/containers/Post', getData: () => ({ post }) })) } ]; }, plugins: ['react-static-plugin-sass', 'react-static-plugin-react-router'] };