A URL Shortener
- Clone the repository:
git clone https://github.com/SGSTAR01/url-shortener.git
- Navigate to the project directory:
cd url-shortener
- Install dependencies:
npm install
oryarn install
orpnpm install
- Start the server:
npm start
2.Configure the environment variables by creating a.env
file in the root directory. The following environment variables are required:PORT
: The port on which the server will run.DB_CONNECTION_STRING
: The URI of the MongoDB database.DB_NAME
: Name of the MongoDB database.
- Open your browser and visit
http://localhost:3000
or the port your specified in the.env
file. - Enter a long URL and click the "Shorten" button to generate a shortened URL.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.