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
public static class ImageMiddlewareExtensions | |
{ | |
public static IApplicationBuilder | |
UseImageMiddleware(this IApplicationBuilder builder, string path) | |
{ | |
builder.UseMiddleware(typeof(ImageMiddleware), path); | |
return builder; | |
} | |
} |
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
public class ImageMiddleware | |
{ | |
private readonly RequestDelegate _next; | |
private readonly string _path; | |
public ImageMiddleware(RequestDelegate next, string path) | |
{ | |
_next = next; | |
this._path = path; | |
} |
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
using System.Collections.Generic; | |
using System.Linq; | |
namespace Hallmanac | |
{ | |
public class AllUsStates | |
{ | |
public static UsState Alabama { get; } = new UsState("a1103958-42c9-4fda-ab46-a04d41a4783b", 1, "Alabama", "AL"); | |
public static UsState Alaska { get; } = new UsState("afa95187-e5a6-44c6-baf2-0dbb3dcc93b1", 2, "Alaska", "AK"); | |
public static UsState Arizona { get; } = new UsState("c090438e-5f7f-427f-a191-d6ea1be8185b", 3, "Arizona", "AZ"); |
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
angular.element(document).ready(bootstrapper); | |
// to boostrap you need to remove ng-app="app" | |
function bootstrapper() { | |
var initInjector = angular.injector(['ng']); | |
var someval = 'some id'; // here is what you would write in node | |
// or | |
// $http call to go get the value | |
//var $http = initInjector.get('$http'); |