also
router.get('/string', async (ctx, next) => { let a = await axios.get('http://localhost:1111/comments') // Get the backend interface console.log('a' ,a); let obj = { 'name': 'kang', 'age': 24 } ctx.body = a.data // provided to front-end access http://xxx:3000/string })
cross domain
const cors = require('koa2-cors') // Provide an interface to the front end to solve cross-domain app.use(cors()) // cross-domain