The server provides resource-based HTTP for external configuration (name-value pairs or equivalent yaml content). The server can be easily embedded in the spring boot application using @enableconfigserver annotations. So this application is a configuration server: Br/>configserver.java
@SpringBootApplication
public class Configserver {
public static void Main (string[] args) {
Springapplication.run (Configserver.class, args);
}
}
Like all spring boot applications running on the default port 8080, you can switch them to regular port 8888 in a variety of ways. The simplest is also to set a default configuration library, which is spring.config.name=configserver by starting it (there is a configserver.yml in the Config Server jar). The other is to use your own application.properties, for example
Application.properties
server.port:8888
Spring.cloud.config.server.git.uri:file://${user.home}/config-repo
Where ${user.home}/config-repo is the Git repository that contains Yaml and properties files.
Note that in Windows, if the file URL is an absolute drive prefix, such as File:///${user.home}/config-repo, additional "/" is required.
Here's how to create a git repository in the example above:
$ CD $HOME
$ mkdir Config-repo
$ CD Config-repo
$ git init.
$ echo Info.foo:bar > Application.properties
$ git add-a.
$ git commit-m "Add application.properties"
Use the local file system for git repositories for testing only. Use the server to host the configuration library in a production environment.
If you keep only text files, the initial cloning of the configuration library will be quick and efficient. If you start to store binaries, especially large files, you may experience a delay in the first configuration request and/or out-of-memory error in the server.
Spring Cloud config server