// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IGreetingService greetingService)
        {
            loggerFactory.AddConsole();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }



            app.UseFileServer();

            app.UseNodeModules(env);
            //app.UseDefaultFiles();
            //app.UseStaticFiles();

            app.UseIdentity();

            app.UseMvc(ConfigureRoutes);

            app.Run(async(context) =>
            {
                var greeting = greetingService.GetGreeting();
                await context.Response.WriteAsync(greeting);
            });
        }
 public ActionResult Index(
     IGreetingService greetingService,
     string name)
 {
     ViewBag.Greeting = greetingService.GetGreeting(name);
     
     return View();
 }
Beispiel #3
0
 public Task Invoke(HttpContext ctx, IGreetingService service)
 {
     if (ctx.Request.Path.StartsWithSegments(_options.Path))
     {
         return(ctx.Response.WriteAsync(service.GetGreeting()));
     }
     else
     {
         return(_next(ctx));
     }
 }
 // GET: Greeting
 public ActionResult Index()
 {
     ViewData["val"] = _greetingService.MSG;
     ViewData["msg"] = _greetingService.GetGreeting();
     return(View());
 }
        public IActionResult Get()
        {
            database.Save();

            return(Ok(greetingService.GetGreeting()));
        }
 // GET: /<controller>/
 public IActionResult Index()
 {
     ViewData["message"] = _greetingService.GetGreeting() + " " + _secondService.GetGreeting();
     return(View());
 }
Beispiel #7
0
 public ActionResult Index()
 {
     return(Content(_greetingService.GetGreeting()));
 }
Beispiel #8
0
        public async Task <IActionResult> GetIndex([FromQuery] GreetingRequest req)
        {
            var greeting = await _greetingService.GetGreeting(req);

            return(Content(greeting.Message));
        }