Loading...
1 - Client requests the api using the longURL
2 - If it exists in the database, return it
3 - If it doesn't exist in the database, generate a new unique ID
3.1 - Convert the ID to shortURL using the base64 conversion
3.2 - Save ID, shortURL, longURL in the DB.
1 - Client requests the api using the longURL
2 - If it exists in the database, return it
3 - If it doesn't exist in the database, generate a new unique ID
3.1 - Convert the ID to shortURL using the base64 conversion
3.2 - Save ID, shortURL, longURL in the DB.
We can use base64 to convert the unique ID to a shortURL.