// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure( IApplicationBuilder app, IHostingEnvironment env, IWordsRepository words) { app.UseStaticFiles(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error/View"); } app.Run(async(context) => { var thirdWord = words.Find(2); await context.Response.WriteAsync(thirdWord.Text); }); }