The URL Shortener is a CLI made to shorten long URLs into more easily usable ones. The app takes the URL, creates a key, converts the key to a base62 format, and returns the shortened version to the user. When the shortened URL is accessed, the server redirects users to the original URL!
The application also includes validation:
- Java
- Spring Boot
- Spring Data MongoDB
- Maven
- MongoDB
- JUnit (for testing)
- Javascript
- Node.js
- AJAX
- Inquirer
- Node.js 20
- Maven 3.9
- JDK 20
- Clone the github repository.
git clone https://github.com/emikobell/url-shortener
- Create and connect your MongoDB database by creating an application.properties file under src/main/resources. The format should look like:
spring.data.mongodb.uri=mongodb+srv://<username>:<pwd>@<cluster>.mongodb.net/urldata
spring.data.mongodb.database=urldata
- Run the Spring Boot application.
mvn spring-boot:run
-
If there are no exceptions, the server is now up!
-
Navigate to cli and install the node dependencies in package.json:
cd cli
npm install
- Install the url-shortener CLI. The -g flag installs it globally (you can omit this if you would like).
npm install -g .
- Run the url shortener application.
url-shortener
- Docker containers