Closed toenuff closed 8 years ago
@adamdriscoll put together a prototype of a DSL instead of a hash Implemented here in a busted branch: https://github.com/adamdriscoll/flancy/blob/dsl/flancy.psm1
This is a nice way to visualize and control what is allowed. Once this is implemented, we can do staticfiles and staticdirs as a keyword as well. It also feels a lot more like flask.
Adam documented how it would be used here: https://github.com/adamdriscoll/flancy/blob/dsl/example.ps1
basically:
new-flancy -url $url -Authentication Token -webschema @( Get '/' { "Welcome to Flancy!" } Get '/Process' { Get-Process | select name, id, path | ConvertTo-Json } Post '/Process' { $processname = (new-Object System.IO.StreamReader @($Request.Body, [System.Text.Encoding]::UTF8)).ReadToEnd() Start-Process $processname } Get '/process/{name}' { get-process $parameters.name |convertto-json -depth 1 } Get '/prettyprocess' { Get-Process | ConvertTo-HTML name, id, path } Post '/authenticate' { New-Token -UserName "Adam" -Context $Context } )
I'm working on porting this into the devel branch without the token stuff since that is still broken
Thanks. My fork is all jacked right now....
@adamdriscoll put together a prototype of a DSL instead of a hash Implemented here in a busted branch: https://github.com/adamdriscoll/flancy/blob/dsl/flancy.psm1
This is a nice way to visualize and control what is allowed. Once this is implemented, we can do staticfiles and staticdirs as a keyword as well. It also feels a lot more like flask.
Adam documented how it would be used here: https://github.com/adamdriscoll/flancy/blob/dsl/example.ps1
basically: