This commit is contained in:
Tommy Parnell
2017-10-13 22:26:47 -04:00
parent da2f9c25cc
commit 6d414c79b4
14 changed files with 64 additions and 113 deletions

View File

@@ -1,16 +1,13 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
# Visual Studio 15
VisualStudioVersion = 15.0.26730.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9EE482C9-26E6-43DF-9C81-A4BE3ED75D67}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{68D81769-33DC-48FA-967A-0E1DB7DC254D}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "api.tparnell.io", "src\api.tparnell.io\api.tparnell.io.xproj", "{C3A3F90B-675C-419E-BC1D-811648F9B396}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "api.tparnell.io", "src\api.tparnell.io\api.tparnell.io.csproj", "{C3A3F90B-675C-419E-BC1D-811648F9B396}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -29,4 +26,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{C3A3F90B-675C-419E-BC1D-811648F9B396} = {9EE482C9-26E6-43DF-9C81-A4BE3ED75D67}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {73034B9A-E5E3-474B-9B04-8D2839069F37}
EndGlobalSection
EndGlobal

View File

@@ -1,6 +0,0 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-final"
}
}

View File

@@ -2,7 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

View File

@@ -2,9 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Hosting;
namespace api.tparnell.io.Controllers
{

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNetCore.Mvc;
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
@@ -16,7 +16,7 @@ namespace api.tparnell.io.Controllers
{
using(var t = new HttpClient())
{
var data = await t.GetAsync("http://resume.tparnell.io/resume.json");
var data = await t.GetAsync("http://resume.terribledev.io/resume.json");
this.Response.ContentType = data.Content.Headers.ContentType.MediaType;
return new FileStreamResult(await data.Content.ReadAsStreamAsync(), data.Content.Headers.ContentType.MediaType);
}

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNetCore.Mvc;
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
@@ -14,7 +14,7 @@ namespace api.tparnell.io.Controllers
{
["Linkedin"] = "https://www.linkedin.com/in/tommy-parnell-63a72224",
["Twitter"] = "https://twitter.com/TerribleDev",
["Github"] = "https://github.com/tparnell8"
["Github"] = "https://github.com/terribledev"
};
public IActionResult Index() => new JsonResult(endpoints);

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNetCore.Mvc;
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
@@ -12,10 +12,10 @@ namespace api.tparnell.io.Controllers
{
private static readonly Dictionary<string, IEnumerable<string>> endpoints = new Dictionary<string, IEnumerable<string>>
{
["AboutMe"] = new List<string>() { "about.tparnell.io", "about.tommyparnell.com" },
["Resume"] = new List<string>() { "resume.tparnell.io", "resume.tommyparnell.com" },
["AboutMe"] = new List<string>() { "about.terribledev.io", "about.tommyparnell.com" },
["Resume"] = new List<string>() { "resume.terribledev.io", "resume.tommyparnell.com" },
["LetMeLycosThatForYou"] = new List<string>() { "lmltfy.xyz" },
["api"] = new List<string>() { "api.tparnell.io" },
["api"] = new List<string>() { "api.terribledev.io" },
["dotnetmashup"] = new List<string>() { "dotnetmashup.azurewebsites.net" }
};
@@ -31,7 +31,7 @@ namespace api.tparnell.io.Controllers
{
return Redirect("http://" + endpoints[id].First());
}
return HttpNotFound();
return NotFound();
}
}
}

View File

@@ -0,0 +1,22 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using System;
using System.Collections.Generic;
using System.Text;
namespace api.tparnell.io
{
public static class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
}
}

View File

@@ -2,26 +2,22 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
namespace api.tparnell.io
{
public class Startup
{
public Startup(IHostingEnvironment env)
public Startup(IConfiguration configuration)
{
// Set up configuration sources.
var builder = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.AddEnvironmentVariables();
Configuration = builder.Build();
Configuration = configuration;
}
public IConfigurationRoot Configuration { get; set; }
public IConfiguration Configuration { get; set; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
@@ -47,8 +43,6 @@ namespace api.tparnell.io
{
app.UseExceptionHandler("/Home/Error");
}
app.UseIISPlatformHandler();
app.UseStaticFiles();
app.UseMvc(routes =>
{
@@ -57,8 +51,5 @@ namespace api.tparnell.io
template: "{controller=Home}/{action=Index}/{id?}");
});
}
// Entry point for the application.
public static void Main(string[] args) => WebApplication.Run<Startup>(args);
}
}

View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>
</Project>

View File

@@ -1,23 +0,0 @@
<?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>c3a3f90b-675c-419e-bc1d-811648f9b396</ProjectGuid>
<RootNamespace>api.tparnell.io</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>

View File

@@ -2,9 +2,7 @@
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Verbose",
"System": "Information",
"Microsoft": "Information"
"Default": "Warning"
}
}
}

View File

@@ -1,43 +0,0 @@
{
"version": "1.0.0-*",
"webroot": "wwwroot",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final",
"System.Net.Http": "4.0.1-beta-23516"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
},
"frameworks": {
"dnx451": {
}
},
"exclude": [
"wwwroot",
"node_modules"
],
"publishExclude": [
"**.user",
"**.vspscc"
],
"scripts": {
"prepublish": [ ]
}
}

View File

@@ -55,7 +55,8 @@
function go() {
$('#go').prop('disabled', true);
$.ajax({
url: $('#urldata').val()
url: $('#urldata').val(),
dataType: 'json'
})
.done(function (data) {
var result;