Polaris一个PowerShell 6的跨平台,简约的Web框架

网友投稿 596 2022-10-28

Polaris一个PowerShell 6的跨平台,简约的Web框架

Polaris一个PowerShell 6的跨平台,简约的Web框架

Polaris

A cross-platform, minimalist web framework for PowerShell.

Disclaimer

Polaris is currently an unsupported, experimental, proof-of-concept. There is no current plan to turn it into a supported Microsoft product.

That being said, we do plan on continuing to experiment within this repository for the foreseeable future.

Example

New-PolarisGetRoute -Path "/helloworld" -Scriptblock { $Response.Send('Hello World!')}Start-Polaris

Why yet another web framework for PowerShell?

There have been a great list of other micro web frameworks written over the years (Thanks @jaykul for the list!).

Polaris' differentiation is that it is cross-platform and uses the .NET HttpListener class.

Getting Started

Prerequisites

PowerShell

Steps

From the PowerShell Gallery

PS > Install-Module -Name Polaris -Scope CurrentUser -Force

You can now try out the example above or checkout the site for more usage information!

From source

Clone or download the zip of the repoOpen PowerShellAt this point, you can now run Import-Module ./Polaris.psd1

You can now try out the example above or checkout the site for more usage!

You can also run all the Pester tests by running Invoke-Pester in the test directory. You will need Pester version 4.1.0 or higher to run the tests on Linux or MacOS.

Documentation

Check out the docs folder or the site for a full API reference.

Troubleshooting / Questions

Twitter: #PSPolarisSlack: See us in the #Polaris channel of the PowerShell SlackGitHub Issues: Submit a bug / new feature idea / or just a question as a new GitHub issue

Roadmap

We have a few paths we are interested in taking. We hope the community helps direct us.

Expanding on the current implementation using HttpListener to deliver features you'd expect from projects ASP.NET or Expressjs (route parameters, query parameters, middleware, auth etc)Investigating the use of Kestrel/ASP.NET Routing instead of HttpListenerCreating a routing domain-specific language (DSL) for isolating and running script blocks as routes. Drawing inspiration from Pester.

Feedback

This project is an experiment that has the possibility to grow into something great. We can't do that without great feedback from you.

If you have an idea or find a bug, join the discussions in the issues or create a new issue.

License

Polaris is licensed under the MIT License.

Maintainers

Tyler Leonhardt - @TylerLeonhardtMicah Rairdon - @tiberriver256

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Adobe After Effects CS5.5 中文化…
下一篇:代理设计模式8--代理模式探索
相关文章

 发表评论

暂时没有评论,来抢沙发吧~