Micronaut development environment
I use Micronaut Default Environment to define a development environment.
I replace the Application
class:
public class Application {
public static void main(String[] args) {
Micronaut.run(Application.class, args);
}
}
with:
public class Application {
public static void main(String[] args) {
Micronaut.build(args)
.mainClass(Application.class)
.defaultEnvironments(Environment.DEVELOPMENT)
.start();
}
}
Then, I add to .gitignore
a configuration file for the dev
environment.
...
..
.
src/main/resources/application-dev.yml
What do I use application-dev.yml
for? I have configuration for my local database, disable cookie access restriction while running in localhost
, etc. Because of the git ignore inclusion, each developer in the team can have an application-dev.yml
tailored to his machine.
Tags: #micronaut #environment