A simple webapp, tinyurl-alike, built with Spring Boot.
- http://clipapp.herokuapp.com/{TINY_URL}: redirects to the original URL if existing, otherwise redirects to the web ui.
- http://clipapp.herokuapp.com/{TINY_URL}: outputs the original URL if existing, otherwise throws an error.
{
"url": "https://www.google.ca"
}
- http://clipapp.herokuapp.com/?u={LONG_URL}: outputs a tiny URL. If already available in the system, it gives the already associated tiny URL. If long URL malformed, throws an error.
{
"value": "jfcnsie"
}
- jdk8+
- maven
- postgresql 10.x, with database clipapp created (optional, for data persistance: use Spring profile
database
) - redis (optional, for caching: use Spring profile
redis-caching
)
mvn spring-boot:run -Dspring.profiles.active=<profiles>
where <profiles>
can be:
simple
: everything in memorydatabase
: uses postgresql for storageredis-caching
: uses redis for cachingdatabase,redis-caching
: 2+3
refer to project's application.yml for default settings, or override them.
because why not.
mvn install
docker run --name clipapp -p 8080:8080 -e SPRING_PROFILES_ACTIVE=<profiles> clipapp:0.0.1-SNAPSHOT