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


Server Ports

Property Default Description
server.host localhost Bind address for the Admin API
server.admin.port 9090 Admin API port
server.redirect.port 8081 Public 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

Property Values Default
storage.mode memory, eclipsestore memory
storage.path any 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

Property Default Description
statistics.hot-window-hours 24 Hours kept in hot (hourly) buckets

Alias Policy

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

Setting Value
Minimum length 3 characters
Maximum length 32 characters
Allowed chars [A-Za-z0-9_-]
Reserved aliases api, about, create, delete, list
Case sensitive No (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