PHP code example of m1guelpf / fly-api

1. Go to this page and download the library: Download m1guelpf/fly-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

m1guelpf / fly-api example snippets

 php
$fly = new \M1guelpf\FlyAPI\Fly('YOUR_FLY_API_TOKEN');
 php
$fly = new \M1guelpf\FlyAPI\Fly();

$fly->connect('YOUR_FLY_API_TOKEN');
 php
$fly->getHostnames($slug);
 php
$fly->createHostname($slug, $hostname);
 php
$fly->getHostname($slug, $hostname);
 php
$fly->createBackend($slug, $name, $type, $settings);
 php
$fly->createRule($slug, $hostname, $backend_id, $action_type, $path, $priority, $path_replacement);
 php
$fly->getClient();
 php
$client = new \GuzzleHttp\Client(); // Example Guzzle client
$fly->setClient($client);