-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(issue-117): implement the api for versioning (e-sender api)
Merge pull request #118 from live-dev999/live-dev999/issue117
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/Services/e-sender/O2NextGen.ESender.Api/Controllers/VersionController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Reflection; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace O2NextGen.ESender.Api.Controllers | ||
{ | ||
[AllowAnonymous] | ||
public class VersionController : ControllerBase | ||
{ | ||
#region Fields | ||
|
||
private readonly IHostingEnvironment _environment; | ||
|
||
#endregion | ||
|
||
|
||
#region Ctors | ||
|
||
public VersionController(IHostingEnvironment environment) | ||
{ | ||
_environment = environment; | ||
} | ||
|
||
#endregion | ||
|
||
[HttpGet("[controller]")] | ||
public object Index() | ||
{ | ||
var exVersion = Assembly.GetExecutingAssembly().GetName().Version; | ||
return new | ||
{ | ||
Environment = _environment.EnvironmentName, | ||
Version = exVersion.ToString() | ||
}; | ||
} | ||
} | ||
} | ||
|
||
|