package com.pj;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

import java.io.File;
import java.util.Properties;


/**
 * gateway 服务网关-启动 
 * @author kong 
 */
@EnableDiscoveryClient			// 注册中心 
@SpringBootApplication		// SpringBoot注解
public class SpGatewayApplication {
	
	public static void main(String[] args) {
		Properties properties = System.getProperties();
		String rootPath = properties.getProperty("user.dir");
		SpringApplication application = new SpringApplication(SpGatewayApplication.class);
		application.addListeners(new ApplicationPidFileWriter(rootPath + File.separator + "app.pid"));
		application.run(args);
		System.out.println("\n--------------- SpGatewayApplication 服务网关启动成功 ---------------\n");
	}
	
}
