22 lines
413 B
C#
22 lines
413 B
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace ApplicationHub.Controllers.Message;
|
|
|
|
[Route("/api/greet")]
|
|
[ApiController]
|
|
public class GreeterController
|
|
{
|
|
[HttpGet("{name}")]
|
|
public string Greet(string name)
|
|
{
|
|
return $"Hello, {name}";
|
|
}
|
|
|
|
[Authorize]
|
|
[HttpGet("internal")]
|
|
public string SecureGreet()
|
|
{
|
|
return "";
|
|
}
|
|
} |