Enabling static files

A website that only ever returns a single plain text message isn't very useful! At a minimum, it ought to return static HTML pages, CSS stylesheets the web pages use, and any other static resources such as images and videos.

In both Visual Studio 2017 and Visual Studio Code, add a new file to the wwwroot folder named index.html, and modify its content to link to CDN-hosted Bootstrap, and use modern good practices such as setting the viewport, as shown in the following markup:

Make sure that you put the index.html file in the wwwroot folder!
<!DOCTYPE html><html lang="en"><head>  <meta charset="utf-8" />  <meta name="viewport" content=   "width=device-width, initial-scale=1, shrink-to-fit=no" />  <link rel="stylesheet"  href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" ...

Get C# 7.1 and .NET Core 2.0 – Modern Cross-Platform Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.