PSGI: What is it and what's the fuss about?

前端 未结 3 1156
感情败类
感情败类 2020-12-24 02:59

I have been trying to decide if my web project is a candidate for implementation using PSGI, but I don\'t really see what good it would do for my application at this stage.<

3条回答
  •  粉色の甜心
    2020-12-24 03:30

    Borrowing from a recent blog post by chromatic, Why PSGI/Plack Matters (Testing), here's what it is:

    It's a good idea borrowed from Python's WSGI and Ruby's Rack but made Perlish; it's a simple formalizing of a pattern of web application development, where the entry point into the application is a function reference and the exit point is a tuple of header information and a response body.

    That's it. That's as simple as it can be, and that simplicity deceives a lot of people who want to learn it.

    An important benefit is, ibid.,

    Given a Plack application, you don't have to deploy to a web server—even locally—to test your application as if it were deployed … Plack and TWMP (and Plack::Test) use the well-defined Plack pattern to make something which was previously difficult into something amazingly easy. They're not the first and they won't be the last, but they do demonstrate the value of Plack.

提交回复
热议问题