所需工具:Mongodb数据库,express,Router,node

1.连接Mongodb数据库:需要安装(mongoose) 不需要抛出。
node如何使用express编写api
2.添加字段然后通过mongoose,model()转为数据模型:需要(Schema) 需要抛出此模块。
node如何使用express编写api
3.(1)创建端口号 app.listen 无回调函数以及POST请求参数配置 (body-parser)app.use(),然后指定router路由写法。
node如何使用express编写api
4.编写您的api,然后通过路由模块名.insertMany()添加到您的数据库。
node如何使用express编写api

相关文章:

  • 1970-01-01
  • 2021-09-09
  • 2022-12-23
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
猜你喜欢
  • 2021-12-20
  • 2021-07-25
  • 2021-05-31
  • 2021-09-19
  • 2021-12-26
  • 2021-09-16
  • 2022-12-23
相关资源
相似解决方案