Nodejs 微服務


Node js with microservices

Tech

Node.js/ Express.js / Mongo DB/ Mongoose(ODM) /postman /

bodypaser: to receive data from requirest

  1. 創建3個services , students, teachers, classes

 

students service

  1. load express

  2. load mongoose

  3. connect

    1. 使用post方法傳遞數據到MongoDB

    2. use findbyidAndRemove to delete data

    3. use find and findById to search data

連接數據庫的student.js

  1. load mongoose

  2. model

teachers service

  1. load express

  2. load mongoose

  3. connect

  4. 數據庫的互動和student service 一樣

classes service

  1. 我們需要 teacherID to hold teacher identitiy

  2. 用學生ID 看哪個老師來進行教授

  3. gotdate 入學時間

  4. 課程結束時間


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM