database.url = localhost:3306
database.username = myusername
database.password = mypassword
server.port = 8080
server.maxConnections = 100
number = 123
string = "Hello, world!"
boolean = true
database.url = localhost:3306
database.connectionString = jdbc:mysql://${database.url}
# config-default.properties
database.url = localhost:3306
database.username = myusername
database.password = mypassword
# config-prod.properties
database.url = prod-server:3306
import io.activej.inject.annotation.Provides;
import io.activej.remotefs.LocalFsClient;
import io.activej.remotefs.http.HttpActiveFsModule;
import io.activej.remotefs.http.RemoteFsServlet;
import io.activej.remotefs.tcp.ActiveFsServer;
import io.activej.remotefs.tcp.TcpActiveFsServer;
import java.io.IOException;
import java.nio.file.Path;
public class MyApplicationModule {
@Provides
public ActiveFsServer activeFsServer(Config config) throws IOException {
Path storagePath = Path.of(config.get("storage.path", "./storage"));
return TcpActiveFsServer.create(LocalFsClient.create(storagePath));
}
@Provides
public RemoteFsServlet remoteFsServlet(ActiveFsServer activeFsServer) {
return RemoteFsServlet.create(activeFsServer);
}
// ...
}