we use a plain http, language agnostic,
simplistic APIfunction uploadFile(localPath: string, pathOnShard: string): Promise<void> {
const stats = fs.statSync(localPath);
const stream = fs.createReadStream(localPath);
const url = new URL(`${SHARD_URL}/fso`);
url.searchParams.set('path', pathOnShard);
return new Promise((resolve, reject) => {
const req = http.request({
hostname: url.hostname,
port: url.port,
path: url.pathname + url.search,
method: 'POST',
headers: {
'x-user-api-key': API_KEY,
'Content-Type': 'application/octet-stream',
'Content-Length': stats.size
}
}, (res) => {
let body = '';
res.on('data', chunk => body += chunk);
res.on('end', () => {
res.statusCode === 201 ? resolve() : reject(new Error(`${res.statusCode}: ${body}`));
});
});
req.on('error', reject);
stream.on('error', reject);
stream.pipe(req);
});
}
✗ No bandwidth fees
✗ No download charges
✗ No API request fees
✗ No data retrieval costs
✓ Clear maximum charge
3GB
$0.00
50GB
$6.49
100GB
$12.99
Dynamic Max 100GB
$0.05
per GB per day
We believe in simple minimalist solutions
Not in giant clumsy "enterprise products"
We try to make things simple
Not complicated