I have a plan for this pracitce:
-First: A step by step practice to achieve a restful API program, to familiar with nodejs, ExpressJs, Mongodb, Mongoose and other micro server stuffs.
-Second: Convert this product/order program to a todo program
-Third: Make frontend user interface
-Forth: Pack this whole program with electron
- schema
- model
- querry
- crud
-- dependencies : multer: to parse html form data
-
7/9/20 - Failed when I use
populate
to chain product with order. Don't know how to fix it, move on and leave it temporary. -
7/10/20 -
Multer
middleware installed and using it to parse formData from postman. -
7/15/20 - successfully achieve image upload functionality
-
7/15/20 - User Authorize
- Introduce a password encrypt packagenode.bcrypt.js
-
7/18/20 - User login and token generate
- new libraryjsonwebtoken
was introduced to handle token generation and signing works for us.
- Parse the token using JWT -
7/20/20 - write a customed middleware to protect the api data