-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup edge scripting api base class and api docs
- Loading branch information
Showing
8 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Edge Scripting API | ||
|
||
Edge Scripting is a serverless JavaScript platform built on top of Deno, designed to help developers build, deploy, and run JavaScript applications on our massive global network without worrying about hardware, scaling, or load balancing ever again. | ||
|
||
## Setup | ||
|
||
```php | ||
<?php | ||
|
||
require 'vendor/autoload.php'; | ||
|
||
use ToshY\BunnyNet\EdgeScriptingAPI; | ||
use ToshY\BunnyNet\Client\BunnyClient; | ||
|
||
// Create a BunnyClient using any HTTP client implementing "Psr\Http\Client\ClientInterface". | ||
$bunnyClient = new BunnyClient( | ||
client: new \Symfony\Component\HttpClient\Psr18Client(), | ||
); | ||
|
||
// Provide the API key available at the "Account Settings > API" section. | ||
$edgeScriptingApi = new EdgeScriptingAPI( | ||
apiKey: '2cebf4f8-4bff-429f-86f6-bce2c2163d7e89fb0a86-a1b2-463c-a142-11eba8811989', | ||
client: $bunnyClient, | ||
); | ||
``` | ||
|
||
## Usage | ||
|
||
## Reference | ||
|
||
* [Edge Scripting API](https://docs.bunny.net/reference/getedgescriptcodeendpoint_getcode) | ||
* [Blog "Introducing Edge Scripting: A better way to build and run applications at the edge!" (07-11-2024)](https://bunny.net/blog/introducing-bunny-edge-scripting-a-better-way-to-build-and-deploy-applications-at-the-edge/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ToshY\BunnyNet; | ||
|
||
use ToshY\BunnyNet\Client\BunnyClient; | ||
use ToshY\BunnyNet\Enum\Host; | ||
|
||
class EdgeScriptingAPI | ||
{ | ||
/** | ||
* @param string $apiKey | ||
* @param BunnyClient $client | ||
*/ | ||
public function __construct( | ||
protected readonly string $apiKey, | ||
protected readonly BunnyClient $client, | ||
) { | ||
$this->client | ||
->setApiKey($this->apiKey) | ||
->setBaseUrl(Host::API_ENDPOINT); | ||
} | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.