Skip to content

Sabmus/node-secure-server

Repository files navigation

Example of how to secure endpoints

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact
  5. Acknowledgments

About The Project

In this project you'll find a server with regular username and password authentication and JWT token authorization plus permission levels

Built With

  • Express
  • MongoDB

Getting Started

Prerequisites

  • You'll need a MongoDB Atlas account. (the have a free tier)

Installation

  1. Clone the repo
    git clone https://github.com/Sabmus/node-secure-server.git
  2. Install NPM packages
    npm install
  3. Enter your Mongo credentials in .env file
    1. Also make sure that your IP address is added in "Network" tab inside MongoDB Dashboard
  4. Enter keys folder and create a new set of keys with (note that AAA must be replaced with a number of days in which the cert and key will be valid):
    openssl req -x509 -newkey rsa:4096 -nodes -keyout key.pem -out cert.pem -days AAA

Usage

Create users with different permission levels and try each endpoint

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Sabmus

Acknowledgments

About

Project to create a secure node server using express

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published