Exemplo n.º 1
0
        public static int Main(string[] args)
        {
            var microservice = new MicroserviceHostBuilder("hello")
                               .UseDefaultWebStack(listenPortNumber: 5000)
                               .AutoDiscoverComponents()
                               .Build();

            return(microservice.Run(args));
        }
Exemplo n.º 2
0
        public static int Main(string[] args)
        {
            var microservice = new MicroserviceHostBuilder()
                               .UseInjectionAdapterAutofac()
                               .UsePlatformMessaging()
                               .UsePlatformMessagingAdapterKestrel()
                               .UsePlatformRest()
                               .ContributeComponents((existingComponents, newComponents) => {
                newComponents
                .ContributeTransactionScript <HelloWorldTx>();
                newComponents
                .ContributeHttpEndpoint(name: "rest-api")
                .RouteRequestsToRestApiService(protocolName: MessageProtocolInfo.Select.HttpRestNWheelsV1().ProtocolName);
            })
                               .Build();

            return(microservice.Run(args));
        }
Exemplo n.º 3
0
        public static int Main(string[] args)
        {
            var microservice = new MicroserviceHostBuilder("hello")
                               .UseAutofac()
                               .UseKestrel()
                               .UseAngular()
                               .UseMessaging()
                               .UseRest()
                               .UseUidl()
                               .UseMessageProtocol <HttpRestNWheelsV1Protocol>()
                               .UseRestApiHttpEndpoint <HttpRestNWheelsV1Protocol>(listenPortNumber: 5000)
                               .ContributeComponents((existingComponents, newComponents) => {
                newComponents.ContributeTransactionScript <HelloWorldTx>();
                newComponents.ContributeWebApp <HelloWorldApp>(urlPathBase: "/");
            })
                               .UseApplicationFeature <GeneratedCodePrototypesFeatureLoader>()
                               .Build();

            return(microservice.Run(args));
        }