[!NOTE] Divshot war eine frühe Hosting-Plattform für statische Webanwendungen, die 2015 von Google Firebase übernommen wurde. Dieser Leitfaden dient als historische Referenz für ihre deklarative Routing-Spezifikation.
CLI-Workflow
# CLI installieren und authentifizieren
npm install -g divshot-cli
divshot login
# Projekt erstellen und lokalen Server starten
divshot init
divshot server
# In bestimmte Umgebungen deployen
divshot push development
divshot push staging
divshot push production
# Builds zwischen Umgebungen hochstufen
divshot promote staging production
Konfiguration (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": "*"
}
}
}
Umgebungsvariablen & Eigene Domains
# Umgebungsvariablen hinzufügen
divshot env:add production API_KEY=xyz
divshot env:pull production
# Benutzerdefinierte Domain hinzufügen
divshot domains:add www.example.com
# Staging-Umgebungen mit Passwort schützen
divshot protect staging "tester:secretpass"