Ir al contenido

Inicio rápido

import { Steps } from ‘@astrojs/starlight/components’;

Publicá una página en vivo con un solo request. Vas a necesitar un token de API — mirá Autenticación.

  1. Guardá tu token. Ponelo en ~/.shareout/credentials:

    ~/.shareout/credentials
    { "token": "so_your_token_here" }
  2. Publicá una página. ShareOut está detrás de Cloudflare, que puede bloquear los requests crudos de Python. El patrón confiable es construir el JSON en Python y pasarlo por pipe a curl:

    Ventana de terminal
    TOKEN=$(python3 -c "import json,os; print(json.load(open(os.path.expanduser('~/.shareout/credentials')))['token'])")
    python3 - <<'PY' | curl -sS -X POST 'https://shareout.site/v1/publish' \
    -H "Authorization: Bearer $TOKEN" \
    -H 'Content-Type: application/json' \
    --data-binary @-
    import json, sys
    json.dump({
    "name": "Hello ShareOut",
    "slug": "hello-shareout",
    "visibility": "public",
    "files": [{
    "path": "index.html",
    "content": "<!DOCTYPE html><html><body><h1>Hello, world.</h1></body></html>",
    "mime": "text/html",
    "encoding": "utf8"
    }]
    }, sys.stdout)
    PY
  3. Abrí tu URL. La respuesta incluye el link en vivo:

    {
    "artifact": { "id": "art_abc123" },
    "deployment": {
    "slug": "hello-shareout",
    "url": "https://shareout.site/a/hello-shareout/"
    }
    }

Listo — tu página está en vivo. Actualizala cuando quieras publicando de nuevo con el mismo slug; ShareOut crea una nueva versión y conserva las anteriores.