├── .gitignore ├── .env ├── public └── styles.css ├── package.json ├── views ├── index.hbs ├── login.hbs └── register.hbs └── app.js /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | DATABASE = login-db 2 | DATABASE_HOST = localhost 3 | DATABASE_USER = root 4 | DATABASE_PASSWORD = -------------------------------------------------------------------------------- /public/styles.css: -------------------------------------------------------------------------------- 1 | nav { 2 | background-color: black; 3 | color: white; 4 | display: flex; 5 | justify-content: space-between; 6 | padding: 30px 60px; 7 | } 8 | 9 | nav ul { 10 | display: flex; 11 | justify-content: space-around; 12 | align-items: center; 13 | } 14 | 15 | nav li { 16 | list-style: none; 17 | } 18 | 19 | nav li a { 20 | color: white; 21 | text-decoration: none; 22 | font-weight: bold; 23 | padding: 5px 8px; 24 | } 25 | 26 | nav li a:hover { 27 | color: yellow; 28 | text-decoration: none; 29 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodejs-form", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "nodemon app.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "bcryptjs": "^2.4.3", 15 | "cookie-parser": "^1.4.6", 16 | "dotenv": "^16.0.2", 17 | "express": "^4.18.1", 18 | "hbs": "^4.2.0", 19 | "jsonwebtoken": "^8.5.1", 20 | "mysql": "^2.18.1", 21 | "nodemon": "^2.0.19" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /views/index.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |This project demostrates how to implement login and register functionalities with Node.js and MySQL
28 |