amazon web services - How to Deploy and test AWS serverless application (API Gateway) created in .Net Core locally? -


i'm new aws server less programming. i've created sample app. blog(sample available visual studio) using [.net core 1.0], want deploy locally , test it. i've tried aws sam local , localstack i'm confused there no clear explanation or steps .net core application.

can provide me clear steps deploy , execute application locally?

the serverless sample out of box amazon doesn't come simple "press f5" way run code locally.

the easiest way test code locally create sample unit tests. these unit tests include need initialise functions class can run it. move code simple console app or create unit tests cover scenarios want test locally.

here sample unit test project:

public class functiontest : idisposable {      string tablename { get; }     iamazondynamodb ddbclient { get; }      public functiontest()     {         this.tablename = "awsserverless2-blogs-" + datetime.now.ticks;         this.ddbclient = new amazondynamodbclient(regionendpoint.uswest2);          setuptableasync().wait();     }      [fact]     public async task blogtestasync()     {         testlambdacontext context;         apigatewayproxyrequest request;         apigatewayproxyresponse response;          functions functions = new functions(this.ddbclient, this.tablename);          // add new blog post         blog myblog = new blog();         myblog.name = "the awesome post";         myblog.content = "content awesome blog";          request = new apigatewayproxyrequest         {             body = jsonconvert.serializeobject(myblog)         };         context = new testlambdacontext();         response = await functions.addblogasync(request, context);         assert.equal(200, response.statuscode); 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -