Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shreyasgkhakal100/api.js-mongo
API Liabrary Built for Node Js on Express & Mongoose.
https://github.com/shreyasgkhakal100/api.js-mongo
Last synced: 11 days ago
JSON representation
API Liabrary Built for Node Js on Express & Mongoose.
- Host: GitHub
- URL: https://github.com/shreyasgkhakal100/api.js-mongo
- Owner: Shreyasgkhakal100
- License: mit
- Created: 2022-02-17T02:34:17.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-15T01:56:17.000Z (almost 3 years ago)
- Last Synced: 2024-10-13T13:23:02.723Z (2 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# APIJS-Mongo
## Why
APIJS-Mongo is the nodejs liabrary built on other liabraries like express, mongoose, etc. to make creating api easier for new users and also to reduce the coding time of the experience user.
## Installing Package:-
For Installing NPM Package Run Following command on your terminal.
`
npm i apijs-mongo
`## Usage:-
Right now this liabrary only have two methods as this is the starting phase of this liabrary, We are creating much more methods for user but rightnow only two methods are available to users. so these two methods are as follow:
For Installing NPM Package Run Following command on your terminal.
`
npm i apijs-mongo
`### Connect Your Server To MongoDB:-
To connect you node server to the mongodb dataabase you have to use our
`
connectToMongoDB
`This will take two argument (1) PORT & (2) MongoDB Cluster Connection Link.
So final method will look like:-
```
const apijs = require('apijs-mongo');
apijs.connectToMongoDB(, );
```### Creating User API:-
To create basic user API use following method
`
createUserAPI
`This will take three arguments (1) route, (2) Require fields in your Schema in form of Array & (3) Object of settings like to remove versionKeys and add timestamps to your data.
So final method will look like:-
```
apijs.createUserAPI("users", ["first_name", "last_name", "email"], {timestamps: true, versionKey: false});
// apijs.createUserAPI("users", ["first_name", "last_name", "email"]);```
So in this methhod its upto you wheter you want to pass setting object or not, if you haven't pass it then user will be created or updated with version keys.
## creators:-
### (1) Shreyas Khakal:- [GitHub Profile](https://github.com/Shreyasgkhakal100)