Serving static filesΒΆ

For more information, please refer to the API documentation of HttpFileService and HttpFileServiceBuilder.

import com.linecorp.armeria.server.ServerBuilder;
import com.linecorp.armeria.server.file.HttpFileService;

ServerBuilder sb = new ServerBuilder();
sb.serviceUnder("/images/",
                HttpFileService.forFileSystem("/var/lib/www/images"));

sb.serviceUnder("/",
                HttpFileService.forClassPath("/com/example/files"));