Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robinofskii/genericapi
A generic REST API built on Express and Mongoose, used for testing some of my own smaller projects.
https://github.com/robinofskii/genericapi
Last synced: about 1 month ago
JSON representation
A generic REST API built on Express and Mongoose, used for testing some of my own smaller projects.
- Host: GitHub
- URL: https://github.com/robinofskii/genericapi
- Owner: robinofskii
- License: mit
- Created: 2020-08-25T17:12:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-29T17:15:38.000Z (over 2 years ago)
- Last Synced: 2023-09-06T15:45:06.294Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 243 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://cloud.mongodb.com/), 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](https://jwt.io/) 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](https://insomnia.rest/) for sending requests.
## License
[MIT](https://choosealicense.com/licenses/mit/)