Skip to content

Latest commit

 

History

History
90 lines (65 loc) · 1.85 KB

README.md

File metadata and controls

90 lines (65 loc) · 1.85 KB

💻 Login Template

A simple login and register template with Node Js

🛠 Project status

Project finished and ready to use

📃 Project task list

  • ✅ Folder Structures
  • ✅ JWT & Errors Middleware
  • ✅ User Controller
  • ✅ API Routing
  • ✅ User Model
  • ✅ User Service
  • ✅ API Testing

⚙ Run Locally

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

🔎 API Reference

Register New User

  POST /users/register
Http Body:
Parameter Type Description
username string Required. The user name
password string Required. The user password
email string Required. The user email

Login User

  POST /users/login
Http Body:
Parameter Type Description
username string Required. The user name
password string Required. The user password

Example of page protected by authentication

  GET /users/user-profile
Http Headers:
Parameter Type Description
Authorization string Required. Basic + JWT Token of user

Authors