Skip to content

A generic REST API built on Express and Mongoose, used for testing some of my own smaller projects.

License

Notifications You must be signed in to change notification settings

robinofskii/GenericAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GenericAPI

A generic REST API built on Express and Mongoose, used for testing some of my own smaller project. Feel free to Fork and use it for yourself, or maybe make your own variations on it. I don't know what is going to be in here yet and when I'll deem it "finished", but take this as-is without any promises.

Installation

  1. Clone or Fork this repo.
  2. Run npm install to get all dependencies.
  3. Create a .env file in the root folder and add the variables listed below.

Variables

  • PORT Here you can provide a port on which the server will run.
  • DB_CONNECTION This is where you can provide a MongoDB connection string, you will need to create your own account and cluster first.
  • JWT_SECRET To give out tokens to make authentication easier with following requests, a token secret is needed. JWT will use this secret to generate and validate tokens.
  • JWT_EXPIRES_IN The token will expire in the amount of days provided in this variable.

Usage

After installing all dependencies and creating an .env, you can start the server with npm start and send requests to the different routes. I personally use Insomnia for sending requests.

License

MIT

About

A generic REST API built on Express and Mongoose, used for testing some of my own smaller projects.

Resources

License

Stars

Watchers

Forks