Loading...
post createUrl(longUrl,userId, vanityUrl) -> creates a shortUrl
delete deleteUrl(shortUrl,userId) -> deletes a url
update editUrl(shortUrl, customUrl, userId) -> changes a shortUrl based on account status
redirect(shortUrl) -> Directs user to the longUrl when a short url is input
user{
userId: string,
password: string,
accountStatus: String (basic, premium)
}
url {
urlId: string,
shortUrl: string,
longUrl: string,
userId: string
}
createUrl:
redirect:
For createUrl there would have to be a check to see if the user has an appropriate account in order to make custom urls.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?