A simple login and register template with Node Js
Project finished and ready to use
- ✅ Folder Structures
- ✅ JWT & Errors Middleware
- ✅ User Controller
- ✅ API Routing
- ✅ User Model
- ✅ User Service
- ✅ API Testing
Clone the project
git clone https://github.com/marioperdiguero/Login-Template.git
Go to the project directory
cd my-project
Install dependencies
npm install
Create a folder at the root of the project called config. Then, inside that folder create a file called "db.config.js", and inside the file paste the following code:
module.exports = {
db: 'your MongoDB connection string will go here'
}
Start the server
npm run start
POST /users/register
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The user name |
password |
string |
Required. The user password |
email |
string |
Required. The user email |
POST /users/login
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The user name |
password |
string |
Required. The user password |
GET /users/user-profile
Parameter | Type | Description |
---|---|---|
Authorization |
string |
Required. Basic + JWT Token of user |