Building Static Websites
Query data from the uncloud storage network
Want to run a static website that queries dynamic data that you own? With uncloud-p2p you can host a light weight site anywhere, and clients pull the data from the nearest avaliable node. Configure a node with the public data, and Uncloud will distribute it across our storage network, for a fraction of the cost.
Say goodbye to egress fees, clients establish a peer to peer connection directly to their nearest avaliable node.
Implementation Guide
From local files to P2P stream in 5 minutes.
Ingest Data
Load your datasets into your node by simply dragging and dropping files into the Uncloud Dashboard.
Configure Public Access
Create a Public Link to expose your data. You have granular control here: specify exactly which files or directories you want to make accessible to the P2P network.
Integrate the SDK
Copy your
linkId.
This unique identifier allows the
uncloud-p2p
NPM package to discover and query your node from any client
browser.
04 / Technical Implementation
// Install the package
// Establish P2P Connection
nodeId: nodeId
});
await p2p.connect();
await p2p.waitForOpen();
// List Remote Files
// Stream to Memory (Buffer/Text)
if (file.Name.endsWith(".csv")) {
const blob = await p2p.downloadToMemory(file.Name);
stockDataCache.set(file.Name, await blob.text());
}
}
// Direct Download to User Device
Live Result
Fig 1.0: Real-time P2P Visualization App