Closed PavelSmertin closed 6 years ago
I have defined create function in my nuxt.config.js file. axios is not imported in nuxt.config.js and i have an error:
ReferenceError: axios is not defined
feed: [{ path: '/rss_export', // The route to your feed. async create (feed) { feed.options = { title: 'title', description: 'describtion', } const posts = await axios.get('http://localhost:3000/v1/news/').data posts.forEach(post => { feed.addItem({ title: 'test' }) feed.addCategory('funny') feed.addContributor({ // some details }) }) }, cacheTime: 1000 * 60 * 15, type: 'rss2' } ],
what is the best way to setup create function? Give me code example please
Hey @pashtetbezd This looks fine so far, but you need to import axios on top of your file:
const axios = require('axios') // Your nuxt config here
thnx! it works
I have defined create function in my nuxt.config.js file. axios is not imported in nuxt.config.js and i have an error:
what is the best way to setup create function? Give me code example please