Quick reference

Divshot Static Hosting CLI Cheat Sheet

An archival quick reference guide for Divshot static web hosting: divshot.json configuration, routing rules, clean URLs, CLI commands, and redirects.

· Published

[!NOTE] Divshot was an early static web application hosting platform acquired by Google Firebase in 2015. This guide serves as a historical reference for its declarative routing specification.

CLI Workflow

# Install CLI and authenticate
npm install -g divshot-cli
divshot login

# Create a project and run local server
divshot init
divshot server

# Deploy to specific environments
divshot push development
divshot push staging
divshot push production

# Promote builds between environments
divshot promote staging production

Configuration (divshot.json)

{
  "name": "my-static-app",
  "root": "./dist",
  "clean_urls": true,
  "error_page": "404.html",
  "routes": {
    "/*.html": "index.html",
    "/app/**": "app.html",
    "**": "index.html"
  },
  "redirects": {
    "/old-docs/:page": "/new-docs/:page",
    "/blog/rss": {
      "status": 301,
      "url": "https://feeds.example.com/rss"
    }
  },
  "headers": {
    "/assets/**": {
      "Cache-Control": "max-age=31536000"
    },
    "/api/**": {
      "Access-Control-Allow-Origin": "*"
    }
  }
}

Environment Variables & Custom Domains

# Add environment variables
divshot env:add production API_KEY=xyz
divshot env:pull production

# Add custom domain
divshot domains:add www.example.com

# Password protect staging environments
divshot protect staging "tester:secretpass"

Related topics