Skip to content

Instantly share code, notes, and snippets.

@AndrewCraswell
Created March 10, 2016 19:19
Show Gist options
  • Save AndrewCraswell/fa9a999748ad34989847 to your computer and use it in GitHub Desktop.
Save AndrewCraswell/fa9a999748ad34989847 to your computer and use it in GitHub Desktop.
A controller in ASP.NET 4.5 that returns a bundle config file generated by the gulp-bundle-assets package.
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.IO;
using System.Web.Mvc;
namespace DurandalTest.Controllers {
public class DurandalController : Controller {
public ActionResult Index() {
dynamic bundles;
using (StreamReader sr = new StreamReader(Server.MapPath("~/dist/bundle.result.json")))
{
bundles = JObject.Parse(sr.ReadToEnd());
}
return View(bundles);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment