Run the following command in your terminal:
npm install
DB_URL_DEV
- The URL of your local MongoDB database.DB_URL_PROD
- The URL of your production MongoDB database.DB_URL_QA
- The URL of your QA MongoDB database. secret
- The secret key, can be any string.algorithm
- The algorithm used to hash the secret key. Examples are aes256, sha256, md5, etc.EMAIL_ID
- The email address of the email account used to send emails.PASS
- The password of the email account used to send emails.key
- The key used to encrypt and decrypt any string, which is of length 32 and alphanumeric.ivstring
- The initialization vector used to encrypt and decrypt any string, which is of length 16 and alphanumeric.ADMIN_USERNAME
- The username of the admin account.ADMIN_PASSWORD
- The password of the admin account.To run the server, run the following command in your terminal:
npm run dev
- Start server in development mode.npm start
- Start server in production mode.npm test
- Start server in QA mode. routes/admin.js
in your text editor.router.post("/register", upload.array("displaypic", 1), isLoggedIn, isAdmin, registerValidator, register_post);
router.post("/register",upload.array("displaypic", 1), register_post);
POST
request to /register
using POSTMAN{
"username": "SOME_VALUE",
"password": "SOME_VALUE",
"email": "SOME_VALUE",
"name": "SOME_VALUE",
"displaypic": "SOME PICTURE",
"age": "SOME_VALUE",
"role": "admin"
}
routes/admin.js
.