Skip to content

Commit

Permalink
feat(issue-117): implement the api for versioning (e-sender api)
Browse files Browse the repository at this point in the history
Merge pull request #118 from live-dev999/live-dev999/issue117
  • Loading branch information
live-dev999 committed Jan 5, 2022
2 parents 1ef9468 + bb910c5 commit 397605d
Showing 1 changed file with 41 additions and 0 deletions.
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()
};
}
}
}


0 comments on commit 397605d

Please sign in to comment.