use of com.alipay.sofa.rpc.rest.RestServiceImpl in project sofa-rpc by sofastack.
the class RestServerMain method main.
public static void main(String[] args) {
ApplicationConfig application = new ApplicationConfig().setAppName("test-server");
/*
访问地址:
POST http://127.0.0.1:8888/rest/hello/code/name
GET http://127.0.0.1:8888/rest/hello/code
PUT http://127.0.0.1:8888/rest/hello/code/name
DELETE http://127.0.0.1:8888/rest/hello/code
GET http://127.0.0.1:8888/rest/get/1234567890
POST http://127.0.0.1:8888/rest/post/1234567890 bodydddddd
*/
ServerConfig serverConfig = new ServerConfig().setProtocol("rest").setPort(8888).setDaemon(false);
ProviderConfig<RestService> providerConfig = new ProviderConfig<RestService>().setInterfaceId(RestService.class.getName()).setApplication(application).setRef(new RestServiceImpl()).setBootstrap("rest").setServer(serverConfig).setRegister(false);
providerConfig.export();
LOGGER.warn("started at pid {}", RpcRuntimeContext.PID);
}
Aggregations