Optional
causeOptional
stackStatic
Optional
prepareOptional
causeOptional
stackStatic
Optional
prepareOptional override for formatting stack traces
Static
stackStatic
captureCreate .stack property on a target object
diff --git a/docs/classes/_bunny_net_edgescript_sdk_latest.net.socketAddr.InvalidAddr.html b/docs/classes/_bunny_net_edgescript_sdk_latest.net.socketAddr.InvalidAddr.html new file mode 100644 index 0000000..56b2392 --- /dev/null +++ b/docs/classes/_bunny_net_edgescript_sdk_latest.net.socketAddr.InvalidAddr.html @@ -0,0 +1,15 @@ +Optional
causeOptional
stackStatic
Optional
prepareOptional override for formatting stack traces
+Static
stackServes HTTP requests with the provided handler.
+Serves HTTP requests for a PullZone
+If you have an associated PullZone within Bunny, we'll use it on production
+and for local development you can configure it with the url
option.
Tell if it's a v4 [SocketAddr].
+Returns the IP address associated with this socket address.
+Returns the port number associated with this socket address.
+Try to parse a SocketAddrV4
+Bind an Addr
+Format the associated [TcpListener] to a String
+Returns the local socket address of this listener.
+Create a new [TcpListener].
+This repository contains one library for now: the @bunny.net/edgescript-sdk
-which is a little lib which intend to help you develop applications running
-over Bunny.
We choose to run Bunny Scripts with a Deno modified runtime that leverage our -networks and products. To be able to also develop locally as if you were inside -the Bunny Network, we are creating a library which will help you leveraging your -prefered Javascript/Typescript environment locally and benefit from the Bunny -Network for your deployed script.
+This repository contains SDK to enable local development of Bunny.net Edge Scripting: @bunny.net/edgescript-sdk
Bunny.net Edge Scripting is built with a custom Deno runtime that runs on the Bunny.net Edge Scripting. +This SDK provides similar environment to Bunny.net Edge Scripting locally, +so that you can run and debug scripts in your local environment before publishing them.
Even if the Bunny Runtime is very similar to the Deno & Node Runtime, some API -might differ or not being available due to the fact we leverage our network +might differ or not being available due to the fact we leverage our CDN and run scripts in a serverless environment.
-We also have a roadmap and some items are just not priorized yet, if you want -to have those available, reach out to us any times!
With @bunny.net/edgescript-sdk
you can write a script which will work with
Deno, with Node, and within our network.
import * as BunnySDK from "@bunny.net/edgescript-sdk";
function sleep(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}
console.log("Starting server...");
BunnySDK.net.http.serve({ port: 8080, hostname: '127.0.0.1' }, async (req) => {
console.log(`[INFO]: ${req.method} - ${req.url}`);
await sleep(1);
return new Response("blbl");
});
-If you execute this code on a deployed Bunny Script, the serve function will
-always be used to allow requests that goes from your PullZone (let's assume you
-have https://domain-test.b-cdn.net
as a PullZone).
In this case, every curl request to https://domain-test.b-cdn.net
will be
-redirect to the associated Bunny Script.
You have a full list of examples in the example folder you can -use.
-If you execute this code on a deployed Bunny.net Edge Scripting script, the serve function will +be used to execute requests on a connected PullZone.
+Full list of examples is in the example folder.
+
Optional override for formatting stack traces
+