Integrate Webpack and ASP.NET MVC/WebAPI

Quick tour of some tricks I’m using in my Podcasts-Angular2 demo project.

While that project is using Angular2, everything discussed here applies to React or Angular 1.x or any other FE framework you might be using, as long as it builds with webpack.

In fact, not too much here is even webpack specific. It could work easily with any FE framework or tooling that provides some sort of “serve” command that compiles and hosts assets during development time, such as ember serve or the http-server npm package.

Note: this approach makes sense for projects where you want to mix server side razor rendering and javascript rendering. For example, perhaps some of the shell of your site is rendered serverside, but the SPA framework only controls a big ol’ div in the center of the page. If the entire app is driven from the client side, you can use webpack-dev-server’s proxy feature to proxy to the API endpoints

Read More

Talk: Consuming HTTP and JSON APIs in C# at Centriq

Last night I gave a talk on consuming HTTP and JSON APIs in C# to the alumni of Centriq’s application developer program.

I had a good time. These graduates are sharp and excited to learn new things that will help them at their jobs.

I’m grateful for the opportunity and thankful that so many folks came up after to tell me they learned a lot.

Here’s the talk page with all the slides, links, and sample code.

Consuming HTTP and JSON APIs in C#