Example #1
0
        public async Task CreatePorxyTest()
        {
            var config      = new HttpApiConfig();
            var interceptor = new MyInterceptor(config);
            var myApi       = HttpApiProxy.CreateInstance(typeof(IMyApi), interceptor) as IMyApi;

            var result = await myApi.M1(0, 1);

            Assert.Equal(result.Method, typeof(IMyApi).GetMethod("M1"));
            Assert.True(result.Parameters.Length == 2);
            Assert.True((int)result.Parameters.First() == 0);
            Assert.True((int)result.Parameters.Last() == 1);
        }
Example #2
0
        internal ApiGatewayStack(Construct scope, string id, IStackProps props = null) : base(scope, id, props)
        {
            var appConfig = new AppConfiguration
            {
                AppId   = "hello",
                AppName = "Hello",
                Lambdas = new List <LambdaConfiguration> {
                    new LambdaConfiguration {
                        ApiPath      = "/api/{proxy+}",
                        FunctionName = "LambdaFunctionOne"
                    }
                }
            };

            var apiGatewayProxy = new HttpApiProxy(this);

            apiGatewayProxy.Construct(appConfig);
        }