Code Monkey home page Code Monkey logo

polaris's Introduction

Polaris

A cross-platform, minimalist web framework for PowerShell Core 6.

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 forseeable future.

Example

Import-Module –Name .\Polaris.psm1

New-GetRoute -Path "/helloworld" -ScriptBlock {
    param($request,$response);
    $response.Send('Hello World!');
}

Start-Polaris

Getting Started

Prereqs

Steps

  1. Clone or download the zip of the repo
  2. Open PowerShell Core 6
  3. run cd Polaris/PolarisCore
  4. run dotnet restore
  5. run dotnet build
  6. run cd ..

At this point, you can now run Import-Module ./Polaris.psm1 to start using Polaris! Checkout the wiki for more usage!

You can also run all the Pester tests by running Invoke-Pester in the test directory. You may need the fork of Pester that supports PowerShell Core 6.

Installation from the PowerShell Gallery coming soon!

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 etc)

  • Investigating the use of Kestrel/ASP.NET Routing instead of HttpListener

  • Support for Windows PowerShell (5.x and lower)

  • Creating 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.

Limitations

  • Currently, this only works in PowerShell 6. Support for older versions of PowerShell is on the roadmap
  • There's no support for route parameters or query parameters that you would expect from projects like ASP.NET or Express however, we have a few ideas in mind on how to add this ability
  • All script executions happen in a sandboxed runspace which means common parameters can not be shared between routes

License

Polaris is licensed under the MIT License.

Maintainers

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 [email protected] with any additional questions or comments.

polaris's People

Contributors

joeyaiello avatar stevel-msft avatar tylerleonhardt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.