This will require OSX and ZSH installed.
For tests it will require your directory name to match your namespace for tests as it uses the directory name to pass the namespace to xunit
public class AuthModule : NancyModule | |
{ | |
public AuthModule() | |
{ | |
Post("/login", async _ => | |
{ | |
var myclaims = new List<Claim>(new Claim[] { new Claim("Id", "SOME USER ID FROM SOMEWHERE!!") }); | |
var claimsPrincipal = new ClaimsPrincipal(new ClaimsIdentity(myclaims, "MyCookieMW")); |
BITS 32 | |
org 0x08048000 | |
ehdr: ; Elf32_Ehdr | |
db 0x7F, "ELF", 1, 1, 1, 0 ; e_ident | |
times 8 db 0 | |
dw 2 ; e_type | |
dw 3 ; e_machine | |
dd 1 ; e_version |
pipelines.OnError += (ctx, exception) => | |
{ | |
ctx.Items.Add("OnErrorException", exception); | |
return null; | |
}; |
public class Cache : ICache | |
{ | |
private ConcurrentDictionary<string, DateTime> cacheLookup = new ConcurrentDictionary<string,DateTime>(); | |
public Response Get(NancyContext ctx) | |
{ | |
DateTime lastmodified; | |
if(ctx.Request.Method == "GET") //Could be POST as well I guess | |
{ |
public void Configure(IApplicationBuilder app) | |
{ | |
app.UseOwin(x => | |
{ | |
//Use Owin here | |
x.UseFirstPipelineMWThatIsOwin(); | |
//Use ASP.Net Core pipeline inside UseOwin | |
app.Use((context, next) => { | |
context.Request.Headers.Add("CUSTOM", "BOB"); |
CMD+Shift+
in VSCode
to run build task. If not configured VSCode will prompt you to choose a build system, choose CoreCLR, then paste the above json in.
This works on the Nancy code base where the folder structure is:
.
./src/Nancy/
./src/Nancy.Validation.FluentValidation/
./samples/Nancy.Demo.Hosting.Kestrel/
./tests/Nancy.Tests/
<?xml version="1.0" encoding="UTF-8"?> | |
<Scheme | |
version = "1.3"> | |
<BuildAction> | |
<BuildActionEntries> | |
<BuildActionEntry | |
buildForRunning = "YES"> | |
<BuildableReference | |
BuildableIdentifier = "primary" | |
BlueprintIdentifier = "B4528147FFDCD6BD3D2805E8" |
# Path to your oh-my-zsh installation. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="ducknorris" | |
# Uncomment the following line to use case-sensitive completion. |
/** | |
* HTTP Status Codes | |
* Copyright (c) 2012, marlun78 | |
* MIT License, https://gist.github.com/marlun78/bd0800cf5e8053ba9f83 | |
* | |
* Taken from: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes | |
* Visual Studio find regex: ^(\d{3}) ([^\r\n]+)\r\n | |
* Visual Studio replace regex: '$1': '$2', // | |
* Notes wrapped in parens moved manually | |
*/ |