Beginning React+Redux "Music Store" sample

This commit is contained in:
SteveSandersonMS
2016-02-05 23:28:13 +00:00
parent 35e620ae48
commit 5811c98230
69 changed files with 7508 additions and 6 deletions

View File

@@ -20,8 +20,7 @@ module.exports = {
if (enableHotModuleReplacement) {
webpackConfig.entry.main.unshift('webpack-hot-middleware/client');
webpackConfig.plugins.push(
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
new webpack.HotModuleReplacementPlugin()
);
if (enableReactHotModuleReplacement) {

View File

@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNet.NodeServices;
using Microsoft.AspNet.Proxy;
using Microsoft.AspNet.SpaServices;
@@ -52,11 +53,15 @@ namespace Microsoft.AspNet.Builder
Port = devServerInfo.Port.ToString()
});
});
// While it would be nice to proxy the /__webpack_hmr requests too, these return an EventStream,
// and the Microsoft.Aspnet.Proxy code doesn't handle that entirely - it throws an exception after
// a while. So, just serve a 302 for those.
appBuilder.Map(WebpackHotMiddlewareEndpoint, builder => {
builder.RunProxy(new ProxyOptions {
Host = WebpackDevMiddlewareHostname,
Port = devServerInfo.Port.ToString()
});
builder.Use(next => async ctx => {
ctx.Response.Redirect($"http://localhost:{ devServerInfo.Port.ToString() }{ WebpackHotMiddlewareEndpoint }");
await Task.Yield();
});
});
}