aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/configuration/EmbeddedAPIConfig.java
blob: 0541ac259589725be1abdb169ef0e96440552ad5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.juick.www.configuration;

import com.juick.server.configuration.PostConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass(name = "com.juick.server.api.Post")
public class EmbeddedAPIConfig {
    @Bean
    public ConfigurableApplicationContext apiContext() {
        return new SpringApplicationBuilder()
                .sources(PostConfig.class)
                .run("--server.port=8081", "--spring.jmx.enabled=false");
    }
}