This is a simple example of using cookies in an Express.js application.
-
Clone the repository:
git clone https://github.com/visionthex/cookiemonster
-
Install dependencies:
npm install express nodemon cookie-parser bcrypt
To test the cookie feature, follow these steps:
-
Start the server:
npm start
-
Open a web browser or use an API testing tool like Postman.
-
Send a GET request to the following URL:
http://localhost:5050/login?name=YourName
Replace
YourName
with the name you want to set in the cookie. -
After sending the request, you should receive a response indicating that the cookie has been set for the provided name.
-
To verify that the cookie is set, you can send another GET request to:
http://localhost:5050/home
This route will display a personalized welcome message if the
name
cookie is set. -
If the cookie is set correctly, you should see a welcome message with the name you provided earlier.
This is just a simple node server.
- Install dependencies:
node secret.js
- This will show you the hash of the crappy password provided. You can change the thePlainTextPassword with whatever you want to see the hash.
let thePainTextPassword = "Replace-with-anything";
This project is licensed under the MIT License - see the LICENSE file for details.