2017 © Pedro Peláez
 

library stackphp-ampcors

AMP CORS middleware for StackPHP

image

zmarquez/stackphp-ampcors

AMP CORS middleware for StackPHP

  • Wednesday, January 31, 2018
  • by zmarquez
  • Repository
  • 1 Watchers
  • 0 Stars
  • 43 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 16 % Grown

The README.md

AMP CORS middleware for StackPHP

This package contains a StackPHP middleware that manages the AMP security CORS requests., (*1)

Options

The AmpCorsMiddleware accepts an array of options:, (*2)

  • publisherOrigin: contains the value of the source origin.
  • queryString: array with parameters to add of the request.

Example

<?php

use Zmc\Stack\AmpCorsMiddleware;

require_once __DIR__ . '../vendor/autoload.php';

$app = new Silex\Application();

$stack = (new Stack\Builder())
    ->push(
        AmpCorsMiddleware::class,
        [
            'publisherOrigin' => 'https://example.com',
            'queryString' => [
                'lang' => 'es'
            ]
        ]);

$app = $stack->resolve($app);

$request = Request::createFromGlobals();
$response = $app->handle($request)->send();

$app->terminate($request, $response);

Installation

The recommended way to install AmpCorsMiddleware is through Composer:, (*3)

json { "require": { "zmarquez/stackphp-ampcors": "dev-master" } }, (*4)

The Versions

31/01 2018

dev-master

9999999-dev

AMP CORS middleware for StackPHP

  Sources   Download

MIT

The Requires

 

by Zacarías Márquez

cors stack amp

31/01 2018

v1

1.0.0.0

AMP CORS middleware for StackPHP

  Sources   Download

MIT

The Requires

 

by Zacarías Márquez

cors stack amp

22/01 2018

v0.1.1

0.1.1.0

AMP CORS middleware for StackPHP

  Sources   Download

MIT

The Requires

 

by Zacarías Márquez

cors stack amp

19/01 2018

v0.1

0.1.0.0

AMP CORS middleware for StackPHP

  Sources   Download

MIT

The Requires

 

by Zacarías Márquez

cors stack amp