Skip to content

Instantly share code, notes, and snippets.

@mercs600
Last active April 5, 2020 16:07
Show Gist options
  • Save mercs600/97d14e5a5d8268716851af9480abc41d to your computer and use it in GitHub Desktop.
Save mercs600/97d14e5a5d8268716851af9480abc41d to your computer and use it in GitHub Desktop.
nuxt-exercise-6-fake-api
export default function (req, res, next) {
const menu = [
{
label: 'Home',
link: '/'
},
{
label: 'asyncData simple',
link: '/asyncData-basic'
},
{
label: 'asyncData context',
link: '/asyncData-context'
},
{
label: 'blog (asyncData)',
link: '/asyncData-blog'
},
{
label: 'fetch basic',
link: '/fetch-basic'
},
{
label: 'blog (fetch)',
link: '/fetch-blog'
}
]
// res is the Node.js http response object
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(menu));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment