https://github.com/astj/p6-crust-middleware-wrappsgi
https://github.com/astj/p6-crust-middleware-wrappsgi
perl6
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/astj/p6-crust-middleware-wrappsgi
- Owner: astj
- License: artistic-2.0
- Created: 2017-06-06T11:38:06.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-01T08:59:31.000Z (about 9 years ago)
- Last Synced: 2025-02-16T09:41:52.312Z (over 1 year ago)
- Topics: perl6
- Language: Perl6
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/astj/p6-Crust-Middleware-WrapPSGI)
NAME
====
Crust::Middleware::WrapPSGI - An wrapper middleware for legay PSGI apps
SYNOPSIS
========
# An legacy PSGI app
my $psgi-app = -> %env {
(200, [ 'Content-Type' => 'text/plain' ], [ 'Hello World' ]);
};
my $wrapped-app = builder {
# You can add other middlewares which expects Promise as response here.
enable "WrapPSGI";
# And you can add other *legacy* middlewares which expects Capture as response here.
$psgi-app;
};
DESCRIPTION
===========
Crust::Middleware::WrapPSGI is a simple wrapper middleware for legacy PSGI applications. [P6W](P6W) (formally known as PSGI) Version 0.7.Draft expects P6W apps to implement "request-response" protocol. Under the protocol, P6W apps must return a Promise which is kept with a Capture with 3-elements response.
This middleware enables "legacy" PSGI applications which directly returns Capture (that means the application can respond to only psgi protocol) to work with "request-response" protocol.
AUTHOR
======
Asato Wakisaka
COPYRIGHT AND LICENSE
=====================
Copyright 2017 Asato Wakisaka
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.