All configuration is done via JVM system properties (-D flags). No config files are required.


Server Ports

PropertyDefaultDescription
server.hostlocalhostBind address for the Admin API
server.admin.port9090Admin API port
server.redirect.port8081Public redirect port
java -Dserver.host=0.0.0.0 \
     -Dserver.admin.port=9090 \
     -Dserver.redirect.port=8081 \
     -jar urlshortener-server.jar

Security Note: Binding server.host to 0.0.0.0 exposes the Admin API publicly. Use a reverse proxy with authentication in front of it.


Storage Mode

PropertyValuesDefault
storage.modememory, eclipsestorememory
storage.pathany directory path/data

In-Memory (default)

java -jar urlshortener-server.jar

Data is lost on restart. Suitable for development and testing.

EclipseStore (persistent)

java -Dstorage.mode=eclipsestore \
     -Dstorage.path=/var/urlshortener/data \
     -jar urlshortener-server.jar

Data is persisted to disk using EclipseStore’s binary serialization. No SQL schema, no migration scripts.


Statistics

PropertyDefaultDescription
statistics.hot-window-hours24Hours kept in hot (hourly) buckets

Alias Policy

These are compile-time constants in AliasPolicy (can be overridden by subclassing):

SettingValue
Minimum length3 characters
Maximum length32 characters
Allowed chars[A-Za-z0-9_-]
Reserved aliasesapi, about, create, delete, list
Case sensitiveNo (normalized to lowercase)

Full Example

java \
  -Dserver.host=127.0.0.1 \
  -Dserver.admin.port=9090 \
  -Dserver.redirect.port=8081 \
  -Dstorage.mode=eclipsestore \
  -Dstorage.path=/opt/urlshortener/data \
  -Dstatistics.hot-window-hours=48 \
  -jar target/urlshortener-server-*.jar

Docker (Community)

A community-maintained Dockerfile is available in the _tools/ directory:

cd _tools
docker build -t url-shortener .
docker run -p 8081:8081 -p 9090:9090 url-shortener