Persistent storage with updatable URLs

How it works

By default, publish creates immutable files with URLs based on content hash. In advanced mode, you can create updatable files with stable URLs.

Your namespace

Your key generates a unique namespace (first 8 chars of SHA256 hash). Files are stored at: /p/{namespace}/{filename}

Upload a file

# First upload - creates the file
$ echo '{"count": 1}' | curl -sF file=@- -F name=counter.json \
    -H "X-Publish-Key: my-secret-key" https://publish.ip1.cc

https://publish.ip1.cc/p/a8f3b2c1/counter.json
# Update - same key, same name = overwrites
$ echo '{"count": 2}' | curl -sF file=@- -F name=counter.json \
    -H "X-Publish-Key: my-secret-key" https://publish.ip1.cc

https://publish.ip1.cc/p/a8f3b2c1/counter.json

Use from JavaScript

// Save data to your namespace
async function saveData(data) {
  const formData = new FormData();
  formData.append('file', new Blob([JSON.stringify(data)]));
  formData.append('name', 'mydata.json');
  
  const res = await fetch('https://publish.ip1.cc', {
    method: 'POST',
    headers: { 'X-Publish-Key': 'my-secret-key' },
    body: formData
  });
  return await res.text(); // URL
}

// Read it back (no auth needed)
async function loadData() {
  const res = await fetch('https://publish.ip1.cc/p/a8f3b2c1/mydata.json');
  return await res.json();
}

Use cases

Keep your key secret! Anyone with your key can overwrite your files. Use a long random string for production apps.

Generate a secure key

$ openssl rand -hex 32
a7c4e2f8b9d1c3e5a7c4e2f8b9d1c3e5a7c4e2f8b9d1c3e5a7c4e2f8b9d1c3e5