1、创建users.js接口文件(server/interface/users.js)

2、编写接口

nuxt.js中koa2写接口顺序

3、在server中import引入,引入路径(server/index.js)

nuxt.js中koa2写接口顺序

4、在server中引入路由(app.use(users.routes()).use(users.allowedMethods()))

nuxt.js中koa2写接口顺序

5、使用postman进行测试

相关文章:

  • 2021-12-14
  • 2021-09-11
  • 2022-12-23
  • 2021-12-03
  • 2022-01-19
  • 2022-12-23
  • 2021-09-17
猜你喜欢
  • 2021-11-05
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2021-05-20
相关资源
相似解决方案