Monday, May 14, 2012

Dart Language Web Pages from IIS (Windows 7)

Dart Language Development on Local Windows7 / IIS

Setting proper MIME Type to Avoid 404 Errors

If you have started developing your own Dart Language web pages locally under Windows7 for testing with the Dartium browser, you may find yourself initially running into some 404 Not Found errors being thrown from IIS (Internet Information Services) when you access your local ".dart" (file extension) web pages. This happens because IIS does not know what MIME type those .dart files are by default, not that the 404 error displayed gives you any indication of this.

So, it's time to tell IIS that these .dart files are to be recognized. Note: I am using Win7x64 Pro or Ultimate that has IIS installed. Open up IIS Manager (it is under "Administrative Tools" in start-menu), and add the MIME Type. You can do this either at the connections root / server level for all sites or under the Connections "Sites" sub-tree particular to your Dart-containing web applications and pages.

On the right-hand side of the screen, you will see the "MIME Types" icon that you will double-click to open the list of configured types. Now, simply right-click anywhere in that list of existing MIME Types and choose "Add"; a popup window for "Add MIME Type" will be displayed with two fields labeled "File name extension" and "MIME type". Place the value ".dart" in the file extension field and "application/dart" in the MIME type field and click OK.

This is for Client-Side Dart Code

When you now use Dartium to navigate to a .dart web page, it should be recognized and served by IIS to your browser without that 404 error. Notice that this is simply enabling client-side dart code within the Dart-enabled Dartium browser; this is not enabling IIS for server-side Dart. I plan to discuss server-side Dart development in the future, but for now I am working primarily on client-side (code running in the browser) development as I work on some SVG/Dart components.

Continue to read this Software Development and Technology Blog for computer programming articles (including useful free / OSS source-code and algorithms), software development insights, and technology Techniques, How-To's, Fixes, Reviews, and News — focused on Dart Language, SQL Server, Delphi, Nvidia CUDA, VMware, TypeScript, SVG, other technology tips and how-to's, plus my varied political and economic opinions.

No comments: