Express server that implements Basic Authentication, with signup and signin capabilities, using a Mongo database for storage.
Author: Yahya Abu Khalil Links and Resources submission PR Github actions
server.js
server module as a centralized base of operations.404.js
error page not found middleware.500.js
error input/logic middleware.
-[./auth/middleware/basic] verifies login information with username and password. -[./auth/middleware/oauth] verifies login information through username and github OAuth. -[./auth/middleware/bearer] verifies user session information for each required route. -[./auth/middleware/basic] verifies user action permission for each required route.
./auth/models/users-model
is the primary model/collection that is extended into each of product and category.
Clone the repo, and run the following commands to install the required dependencies and dev dependencies.
npm install
to download all that exists inpackage.json
.npm install mongoose
to run the database properly, and start it beforehand.
npm start
to test the server yourself using postman.npm test
to run the thorough testing functions.
Unit testing with: npm test using supertest to test each route.