This simple Node.js application allows a user to sign up and log in. User credentials are stored in a MySQL database.
-
First, clone this project:
git clone <repository_url>
-
Change directory:
cd nodejs-mysql-login
-
Install the required packages:
npm install express mysql body-parser
-
Set up your MySQL database and create a database. Then create a database named
loginpage
. -
Update your MySQL connection details in the
index.js
file:const db = mysql.createConnection({ host: 'localhost', user: 'root', password: '', // Your MySQL password database: 'loginpage' });
-
Start the server:
node index.js
-
Once the application is running, you can access the application by going to
http://localhost:3000/login.html
in your browser. -
To sign up, visit the "/signup" page and enter the required information.
-
To log in, visit the "/login" page and use the credentials you signed up with.
8gtnoe_1.mp4
This project is licensed under the MIT License. See the LICENSE
file for more information.