An URL shortener which can shorten your URLs.
- Just input an URL and press Shorten button then you will get a short URL.
- The shortened URL can be copied by Copy button.
- Press the shortened URL then you can be redirected to the original URL.
- Press "My URLs" on the right top to see all hostory URLs.
-
Pls make sure you have installed Node.js and npm
-
Clone the project to your local directory.
-
Access the project directory through terminal, then type in:
npm install
-
Set environment variable for MongoDB
set MONGODB_URI="Your MongoDB connection string" // for Windows cmd export MONGODB_URI="Your MongoDB connection string" // for bash (MacOS bash terminal and Git bash for Windows) -
Start the project:
npm run start
-
If you see the message as below, then open your browser and enter "http://localhost:3000".
URL Shortener is running on http://localhost:3000 mongodb connected! -
To stop the server:
ctrl + c
- Node.js 16.16.0
- Express 4.18.2
- Mongoose 6.7.0
- Express-Handlebars 4.0.2
- Bootstrap 5.2.2
- Font-awesome 6.2.0
Wei Lin