Skip to content

Instantly share code, notes, and snippets.

@manuwell
Last active September 7, 2020 14:43
Show Gist options
  • Save manuwell/dd4ad0aa256d2df3a2ab2f665ae4977b to your computer and use it in GitHub Desktop.
Save manuwell/dd4ad0aa256d2df3a2ab2f665ae4977b to your computer and use it in GitHub Desktop.
medium - springboot de um jeito diferente
@Slf4j
@SpringBootApplication
@EntityScan({ "com.app.domain.models" })
@EnableJpaRepositories({ "com.app.domain.repositories" })
@ComponentScan({ "com.app.config", "com.app.domain", "com.app.backoffice" })
@EnableAutoConfiguration
public class BackofficeApplication {
public static void main(String[] args) throws Exception {
log.info("STARTING BACKOFFICE APPLICATION");
SpringApplication.run(BackofficeApplication.class, args);
}
}
@Slf4j
@SpringBootApplication
@EntityScan({ "com.app.domain.models" })
@EnableJpaRepositories({ "com.app.domain.repositories" })
@ComponentScan({ "com.app.config", "com.app.domain", "com.app.workers" })
@EnableAutoConfiguration
public class WorkerApplication {
public static void main(String[] args) throws Exception {
log.info("STARTING WORKER APPLICATION");
SpringApplication app = new SpringApplication(WorkerApplication.class);
app.setWebApplicationType(WebApplicationType.NONE); // desligando a interface web
app.run(args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment