Paduan Download dan Install Dependensi yang dibbutuhkan dengan cara dibawah
git clone https://github.com/ahmdsk/BackendNodeJSMongoDB
cd BackendNodeJSMongoDB
npm install
nodemon server.js
Setelah itu local server akan berjalan di port 3000
Sebelumnya kita telah selesai membuat endpoint untuk operasi CRUD Mahasiswa dengan NodeJS dan MongoDB sebagai database nya. untuk selanjutnya ada test pemahaman tentang materi sebelumnya untuk berfokus pada materi restful api backend dengan NodeJS dan MongoDB. test pemahaman atau tugas nya membuat endpoint untuk CRUD Dosen, rekan-rekan dapat mengikuti kode sebelumnya untuk mengerjakan.
Untuk isi object dari collection dosen sebagai berikut:
- nama
- matkul_diampu
- alamat
silahkan dibuat model dari data object diatas pada folder models/
kemudian buat file Dosen.js
jadi pada file models/
terdapat 2 file yaitu Mahasiswa.js
dan Dosen.js
Untuk ketentuan endpoint restful api dosen sebagai berikut:
HTTP METHOD | PATH URL |
---|---|
GET | /dosen |
POST | /dosen |
PUT | /dosen/edit/:id |
DELETE | /dosen/delete/:id |
jika tugas sudah selesai, susun semua endpoint dalam satu collection Postman atau Upload ke github pribadi (pilih salah satu, atau keduanya lebih baik). kemudian share/invite collection postman atau repository github nya ke email [email protected]