A simple URL shortener application built using Node.js, Express.js, MongoDB, and EJS. Also special thanks to Piyush Garg Yt Channel..
- Shorten long URLs into concise, shareable links.
- View statistics for shortened URLs, such as click counts and creation date.
- Easy-to-use interface for both shortening and accessing URLs.
- Node.js: JavaScript runtime for server-side development.
- Express.js: Web application framework for Node.js.
- MongoDB &MONGOOSE: NoSQL database for storing URL data.
- EJS: Templating engine for rendering dynamic HTML pages.
- Node.js and npm installed on your machine.
- MongoDB installed locally or accessible through a cloud service.
-
Clone the repository:
git clone https://github.com/your-username/URL-SHORTNER-NODEJS.git
-
Navigate to the project directory:
cd URL-SHORTNER-NODEJS
-
Install dependencies:
npm install
-
Set up MongoDB:
- Create a MongoDB database and obtain the connection string.
- Update the
../models/url.js
file with your MongoDB connection string.
-
Start the application:
npm start
-
Open your browser and visit http://localhost:3000 to use the URL shortener.
-
Shorten a URL:
- Enter a long URL in the provided input field.
- Click the "Shorten" button to generate a short URL.
-
Access short URLs:
- Enter a short URL in the browser to be redirected to the original long URL.
-
View statistics:
- Navigate to the "Statistics" page to see the number of clicks and creation date for each short URL.
Contributions are welcome! If you find a bug or have a feature request, please open an issue or submit a pull request.
This project is licensed under the MIT License.
- Special thanks to [Name], [Name], and [Name] for their contributions.