Chapter 1 – Understanding the ASP.NET Core React Template

  1. What is the entry point method in an ASP.NET Core app?

A method called Main in the Program class

  1. What is the single HTML page filename in an ASP.NET Core React app created by the template, and what folder is this located in?

A file called index.htmlwhich is located in the public folder with the ClientApp folder

  1. What file are the React app dependencies defined in?

A file called package.json in the ClientApp folder

  1. What npm command will run the React app in the WebPack development server?

npm start

  1. What npm command builds the React app ready for production?

npm run build

  1. What is the method name in a React component class that renders the component?

render

  1. Have a look at the following snippet of code, which configures the request/response pipeline in an ASP.NET Core app
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseAuthentication();
app.UseHttpsRedirection();
app.UseMvc();
}

Which is invoked first in the request/response pipeline, authentication or the MVC controllers?

Authentication

  1. Does the class that configures the services and request/response pipeline need to be called Startup? Or can we give it a different name?

We can give this class a different name by defining this class in IWebHostBuilder that is created, as in the following example:

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>  
WebHost.CreateDefaultBuilder(args).UseStartup<MyStartup>();
  1. What browsers are supported by a React app created by CRA?

All modern browsers, including IE

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.183.117