Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
initial commit attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
mariodivece committed Jan 9, 2016
1 parent 904a96f commit ccf8306
Show file tree
Hide file tree
Showing 21 changed files with 17,916 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Unosquare.PassCore.sln
@@ -0,0 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0A003964-77CA-4779-BD97-BADDD710A745}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3EA980E1-D295-4E61-B2EE-29CFE1EDB2F1}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Unosquare.PassCore.Web", "src\Unosquare.PassCore.Web\Unosquare.PassCore.Web.xproj", "{22E2F79B-7816-4FAB-894D-112759551796}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{22E2F79B-7816-4FAB-894D-112759551796}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22E2F79B-7816-4FAB-894D-112759551796}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22E2F79B-7816-4FAB-894D-112759551796}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22E2F79B-7816-4FAB-894D-112759551796}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{22E2F79B-7816-4FAB-894D-112759551796} = {0A003964-77CA-4779-BD97-BADDD710A745}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions global.json
@@ -0,0 +1,6 @@
{
"projects": [ "src" ],
"sdk": {
"version": "1.0.0-rc1-update1"
}
}
3 changes: 3 additions & 0 deletions src/Unosquare.PassCore.Web/.bowerrc
@@ -0,0 +1,3 @@
{
"directory": "Bower"
}
26 changes: 26 additions & 0 deletions src/Unosquare.PassCore.Web/Controllers/ControllerBase.cs
@@ -0,0 +1,26 @@
using Microsoft.AspNet.Mvc;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Unosquare.PassCore.Web.Models;

namespace Unosquare.PassCore.Web.Controllers
{
abstract public class ControllerBase : Controller
{
private readonly AppSettings m_Settings;
private readonly IConfigurationRoot m_Configuration;

public ControllerBase(IConfigurationRoot configuration)
{
m_Settings = new AppSettings();
ConfigurationBinder.Bind(configuration.GetSection("AppSettings"), m_Settings);
m_Configuration = configuration;
}

protected AppSettings Settings => m_Settings;
protected IConfigurationRoot Configuration => m_Configuration;
}
}
57 changes: 57 additions & 0 deletions src/Unosquare.PassCore.Web/Controllers/ValuesController.cs
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Unosquare.PassCore.Web.Models;
using Microsoft.Extensions.OptionsModel;
using Microsoft.Extensions.Configuration;

// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

namespace Unosquare.PassCore.Web.Controllers
{
[Route("api/[controller]")]
public class ValuesController : ControllerBase
{

public ValuesController(IConfigurationRoot configuration)
: base(configuration)
{
// placeholder
}

// GET: api/values
[HttpGet]
public IEnumerable<string> Get()
{

return new string[] { Settings.ActiveDirectoryRootPath, Configuration.Get<string>("AppSettings:ActiveDirectoryRootPath") };
}

// GET api/values/5
[HttpGet("{id}")]
public string Get(string id)
{
return "value";
}

// POST api/values
[HttpPost]
public void Post([FromBody]string value)
{
}

// PUT api/values/5
[HttpPut("{id}")]
public void Put(int id, [FromBody]string value)
{
}

// DELETE api/values/5
[HttpDelete("{id}")]
public void Delete(int id)
{
}
}
}
9 changes: 9 additions & 0 deletions src/Unosquare.PassCore.Web/Models/AppSettings.cs
@@ -0,0 +1,9 @@
namespace Unosquare.PassCore.Web.Models
{
public class AppSettings
{
public string ActiveDirectoryRootPath { get; set; } = "LDAP://uno-dc-01.ad.unosquare.com";

public bool EnablePasswordRecovery { get; set; } = true;
}
}
25 changes: 25 additions & 0 deletions src/Unosquare.PassCore.Web/Properties/launchSettings.json
@@ -0,0 +1,25 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:29208/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"Hosting:Environment": "Development"
}
},
"web": {
"commandName": "web",
"environmentVariables": {
"Hosting:Environment": "Development"
}
}
}
}
107 changes: 107 additions & 0 deletions src/Unosquare.PassCore.Web/Startup.cs
@@ -0,0 +1,107 @@
namespace Unosquare.PassCore.Web
{
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.OptionsModel;
using System;
using Unosquare.PassCore.Web.Models;

/// <summary>
/// Represents this application's main class
/// </summary>
public class Startup
{
#region Constant Definitions

private const string AppSettingsJsonFilename = "appsettings.json";
private const string AppSettingsSectionName = "AppSettings";
private const string LoggingSectionName = "Logging";
private const string DevelopmentEnvironmentName = "Development";

#endregion

#region Properties

public IConfigurationRoot Configuration { get; set; }

#endregion

#region Constructors and Initializers

/// <summary>
/// Application's entry point
/// </summary>
public static void Main(string[] args) => WebApplication.Run<Startup>(args);

/// <summary>
/// Initializes a new instance of the <see cref="Startup" /> class.
/// This class gets instantiatied by the Main method. The hosting environment gets provided via DI
/// </summary>
/// <param name="environment">The environment.</param>
public Startup(IHostingEnvironment environment)
{
// Set up configuration sources.
var builder = new ConfigurationBuilder().AddJsonFile(AppSettingsJsonFilename);

if (environment.IsEnvironment(DevelopmentEnvironmentName))
{
// This will push telemetry data through Application Insights pipeline faster, allowing you to view results immediately.
builder.AddApplicationInsightsSettings(developerMode: true);
}

builder.AddEnvironmentVariables();
Configuration = builder.Build().ReloadOnChanged(AppSettingsJsonFilename);
}

#endregion

#region Methods

/// <summary>
/// This method gets called by the runtime. Use this method to add services to the container.
/// All arguments are provided through dependency injection
/// </summary>
/// <param name="services">The services.</param>
public void ConfigureServices(IServiceCollection services)
{
services.AddOptions();

// TODO: wait for release version that has additional parameter trackChanges
//services.Configure<AppSettings>(Configuration.GetSection(AppSettingsSectionName));

services.AddSingleton<IConfigurationRoot>(sp => { return Configuration; });
services.AddApplicationInsightsTelemetry(Configuration);
services.AddMvc();
}

/// <summary>
/// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
/// All arguments are provided through dependency injection
/// </summary>
/// <param name="application">The application.</param>
/// <param name="environment">The environment.</param>
/// <param name="loggerFactory">The logger factory.</param>
public void Configure(IApplicationBuilder application, IHostingEnvironment environment, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection(LoggingSectionName));
loggerFactory.AddDebug();

application.UseIISPlatformHandler();

application.UseApplicationInsightsRequestTelemetry();

application.UseApplicationInsightsExceptionTelemetry();

application.UseDefaultFiles();
application.UseStaticFiles();

application.UseMvc();
}

#endregion

}
}
25 changes: 25 additions & 0 deletions src/Unosquare.PassCore.Web/Unosquare.PassCore.Web.xproj
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>

<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>22e2f79b-7816-4fab-894d-112759551796</ProjectGuid>
<RootNamespace>Unosquare.PassCore.Web</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<DnxInvisibleContent Include="bower.json" />
<DnxInvisibleContent Include=".bowerrc" />
<DnxInvisibleContent Include="package.json" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
11 changes: 11 additions & 0 deletions src/Unosquare.PassCore.Web/Unosquare.PassCore.Web.xproj.user
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ActiveDebugProfile>IIS Express</ActiveDebugProfile>
<DebugCLRTypeOverride>Profile</DebugCLRTypeOverride>
<ShowAllFiles>false</ShowAllFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
15 changes: 15 additions & 0 deletions src/Unosquare.PassCore.Web/appsettings.json
@@ -0,0 +1,15 @@
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Verbose",
"System": "Information",
"Microsoft": "Information"
}
},
"AppSettings": {
"ActiveDirectoryRootPath": "HELLO9",
"EnablePasswordRecovery": true
}

}
10 changes: 10 additions & 0 deletions src/Unosquare.PassCore.Web/bower.json
@@ -0,0 +1,10 @@
{
"name": "ASP.NET",
"private": true,
"dependencies": {
"angular": "1.4.6",
"bootstrap": "3.3.5",
"angular-bootstrap": "1.0.0",
"Font-Awesome": "4.5.0"
}
}

0 comments on commit ccf8306

Please sign in to comment.