https://github.com/gotocva/nila-auth
https://github.com/gotocva/nila-auth
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gotocva/nila-auth
- Owner: gotocva
- Created: 2024-03-28T04:50:30.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-28T04:54:43.000Z (about 2 years ago)
- Last Synced: 2025-06-17T02:21:17.039Z (12 months ago)
- Language: JavaScript
- Size: 3.67 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### NilaAuth
This is a simple NilaAuth code snippet for setting up authentication using Express.js. It utilizes MongoDB for database storage and JSON Web Tokens (JWT) for authentication.
### Prerequisites
- Node.js installed on your machine
- MongoDB installed and running locally
- Basic nodejs project
### Installation
```
git clone https://github.com/gotocva/nila-auth
```
### Usage
1. In your project, import `express` and the authentication middleware function `auth` from `nila-auth`:
```javascript
const express = require('express');
const { auth } = require('nila-auth');
const app = express();
const authOptions = {
name: 'siva',
MONGODB_URL: process.env.MONGODB_URL,
JWT_SECRET: process.env.JWT_SECRET
}
auth(app, authOptions);
app.listen(3000, () => {
console.log('Application running on port 3000');
});
```
### API details
#### TODO : Once the auth connected to your project by default it has some api's will update the API documentation soon.
### License
This code is provided under the [MIT License](https://opensource.org/licenses/MIT). Feel free to use it and modify it as needed.
### Author
This NilaAuth was created by Siva Bharathy.
### Acknowledgments
Special thanks to the developers and contributors of Express.js and MongoDB for their amazing work.