nuxt.js中koa2写接口顺序

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

2、编写接口

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

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

5、使用postman进行测试

猜你喜欢

转载自www.cnblogs.com/nayek/p/12535936.html