https://github.com/cybervarun/mongodb-website
Simple login page using nodeJS and MongoDB
https://github.com/cybervarun/mongodb-website
mongodb mongodb-atlas mongodb-database mongodb-driver mongoosejs node node-js nodejs
Last synced: 2 months ago
JSON representation
Simple login page using nodeJS and MongoDB
- Host: GitHub
- URL: https://github.com/cybervarun/mongodb-website
- Owner: CyberVarun
- License: gpl-3.0
- Created: 2023-02-11T16:16:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-04T11:57:29.000Z (9 months ago)
- Last Synced: 2025-01-18T01:31:17.520Z (4 months ago)
- Topics: mongodb, mongodb-atlas, mongodb-database, mongodb-driver, mongoosejs, node, node-js, nodejs
- Language: JavaScript
- Homepage:
- Size: 142 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## A simple login page using node JS & MongoDB.
### Dependencies
```
express": "^4.18.2
mongodb": "5.0
```
### Installation
```bash
npm install express [email protected]
```You can add your mongoDB URI in index.js directly
```JS
const uri = "mongodb+srv://username:password@uri"
```or set and 'URI' environment variable for that as follows
```bash
export URI="mogodb+srv://username:password@uri"
```This also needs a 'PORT' environment variable you can set it as follows:
```bash
export PORT="port_number"
```Default port will be 8080. If 'PORT' variable is not present.
Then add your 'DATABASE' and 'COLLECTION' name in index.js as follows
```JS
const database = client.db("Database_name");
const collec = database.collection("Collection_name");
```
You will also need to change uri in src/js/login.js```JS
sendData("protocol://uri/cred", { data });
```Done!
You can start you server by running
```bash
node index.js
```
NOTE: The index.html uses bootstrap CDN for CSS not bootstrap npm package.
### Sample
