cheatsheets/divshot.html

318 lines
8.6 KiB
HTML

<!doctype html>
<html lang='en' class='no-js '>
<head>
<meta charset='utf-8'>
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
<link href='./assets/favicon.png' rel='shortcut icon'>
<meta content='/divshot.html' name='app:pageurl'>
<title>Divshot cheatsheet</title>
<meta content='Divshot cheatsheet' property='og:title'>
<meta content='Divshot cheatsheet' property='twitter:title'>
<meta content='article' property='og:type'>
<meta content='https://assets.devhints.io/previews/divshot.jpg?t=20200622151222' property='og:image'>
<meta content='https://assets.devhints.io/previews/divshot.jpg?t=20200622151222' property='twitter:image'>
<meta content='900' property='og:image:width'>
<meta content='471' property='og:image:height'>
<meta content="The one-page guide to Divshot: usage, examples, links, snippets, and more." name="description">
<meta content="The one-page guide to Divshot: usage, examples, links, snippets, and more." property="og:description">
<meta content="The one-page guide to Divshot: usage, examples, links, snippets, and more." property="twitter:description">
<link rel="canonical" href="https://devhints.io/divshot">
<meta name="og:url" content="https://devhints.io/divshot">
<meta content='Devhints.io cheatsheets' property='og:site_name'>
<meta content='Others' property='article:section'>
<script async src='https://www.googletagmanager.com/gtag/js?id=UA-106902774-1'></script>
<script>
window.dataLayer=window.dataLayer||[];
function gtag(){dataLayer.push(arguments)};
gtag('js',new Date());
gtag('config','UA-106902774-1');
</script>
<meta property='page:depth' content='1'>
<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
<script>(function(H){H.className=H.className.replace(/\bNoJs\b/,'WithJs')})(document.documentElement)</script>
<script>(function(d,s){if(window.Promise&&[].includes&&Object.assign&&window.Map)return;var js,sc=d.getElementsByTagName(s)[0];js=d.createElement(s);js.src='https://cdn.polyfill.io/v2/polyfill.min.js';sc.parentNode.insertBefore(js, sc);}(document,'script'))</script>
<!--[if lt IE 9]><script src='https://cdnjs.cloudflare.com/ajax/libs/nwmatcher/1.2.5/nwmatcher.min.js'></script><script src='https://cdnjs.cloudflare.com/ajax/libs/json2/20140204/json2.js'></script><script src='https://cdn.rawgit.com/gisu/selectivizr/1.0.3/selectivizr.js'></script><script src='https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js'></script><script src='https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js'></script><![endif]-->
<style>html{opacity:0}</style>
<link rel="stylesheet" href="./assets/2015/style.css?t=20200622151222">
<link href="./assets/style.css?t=20200622151222" rel="stylesheet" />
<link href="./assets/print.css?t=20200622151222" rel="stylesheet" media="print" />
</head>
<body>
<div class='all'>
<div class='site-header'>
<div class='container'>
This is <a href="."><em>Devhints.io cheatsheets</em></a> &mdash; a collection of cheatsheets I've written.
</div>
</div>
<script type='application/ld+json'>
{
"@context": "http://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://google.com/article"
},
"headline": "Divshot cheatsheet",
"image": [ "https://assets.devhints.io/previews/divshot.jpg?t=20200622151222" ],
"description": "The one-page guide to Divshot: usage, examples, links, snippets, and more."
}
</script>
<script type='application/ld+json'>
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "https://devhints.io/#others",
"name": "Others"
}
},{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "https://devhints.io/divshot",
"name": "Divshot"
}
}]
}
</script>
<div class='post-list -single -cheatsheet'>
<div class='post-item'>
<div class='post-headline -cheatsheet'>
<p class='prelude'><span></span></p>
<h1><span>Divshot</span></h1>
<ul class="social-list ">
<li class="facebook link hint--bottom" data-hint="Share on Facebook"><a href="https://www.facebook.com/sharer/sharer.php?u=https://devhints.io/divshot.html" target="share"><span class="text"></span></a></li>
<li class="twitter link hint--bottom" data-hint="Share on Twitter"><a href="https://twitter.com/intent/tweet?text=The%20ultimate%20cheatsheet%20for%20Divshot.%20https://devhints.io/divshot.html" target="share"><span class="text"></span></a></li>
</ul>
</div>
<div class='post-content -cheatsheet'>
<h2 id="getting-started">Getting started</h2>
<h3 id="install-divshot-cli">Install divshot-cli</h3>
<pre><code>$ npm install -g divshot-cli
$ divshot login
</code></pre>
<h3 id="create-divshotjson">Create divshot.json</h3>
<pre><code class="language-json">{
"name": "yourapp",
"root": "./app"
}
</code></pre>
<h3 id="push-your-app">Push your app</h3>
<pre><code>$ divshot push
</code></pre>
<h2 id="configuration">Configuration</h2>
<p>See <a href="https://docs.divshot.com/guides/configuration">configuration reference</a> and <a href="https://docs.divshot.com/guides/routing">routing guide</a>.</p>
<pre><code class="language-json">{
"name": "yourapp",
"root": "./app",
"clean_urls": true,
"clean_urls": ["/app/**", "/!components/**"],,
"error_page": "error.html",
"exclude": [ "Gruntfile.js" ],
"cache_control": {},
"routes": {
"/*.html": "index.html",
"/app/**/*.html": "app.html",
"**": "index.html"
},
"redirects": {
"/old/:segment/path": "/new/path/:segment",
"/some/old/path": {
"status": 302,
"url": "/some/new/path"
}
},
"headers": {
"/cors-stuff/**": {
"Access-Control-Allow-Origin": "*"
},
"/scripts/**": {
"content-type": "text/javascript"
}
}
}
</code></pre>
<h2 id="cli">CLI</h2>
<pre><code class="language-sh">divshot s # server
divshot push [staging|production|development]
divshot pull [staging|production|development]
divshot purge # cleans cache
divshot files
divshot promote development production
divshot open [&lt;env&gt;]
</code></pre>
<h3 id="config">Config</h3>
<p>Edits <code>divshot.json</code></p>
<pre><code>
divshot config:add name your-app-name
divshot config:remove name
</code></pre>
<h3 id="environment-vars">Environment vars</h3>
<pre><code>divshot env:add &lt;env&gt; KEY=value
divshot env:remove &lt;env&gt; KEY
divshot env:pull &lt;env&gt;
</code></pre>
<h3 id="app-management">App management</h3>
<pre><code>divshot create &lt;appname&gt;
divshot rename &lt;newname&gt;
divshot status
divshot destroy
</code></pre>
<p>divshot apps
divshot account</p>
<pre><code>
### Password protect
```sh
divshot protect &lt;env&gt; &lt;username:password&gt;
</code></pre>
<h2 id="custom-domains">Custom domains</h2>
<p>See <a href="http://docs.divshot.com/guides/domains">custom domains guide</a>.</p>
<pre><code class="language-sh">divshot domains:add foo.bar.com
</code></pre>
<p>In your DNS create a <code>CNAME</code>: (no apex domains are supported)</p>
<pre><code>www. CNAME yourname.divshot.io
</code></pre>
</div>
<ul class="social-list ">
<li class="facebook link hint--bottom" data-hint="Share on Facebook"><a href="https://www.facebook.com/sharer/sharer.php?u=https://devhints.io/divshot.html" target="share"><span class="text"></span></a></li>
<li class="twitter link hint--bottom" data-hint="Share on Twitter"><a href="https://twitter.com/intent/tweet?text=The%20ultimate%20cheatsheet%20for%20Divshot.%20https://devhints.io/divshot.html" target="share"><span class="text"></span></a></li>
</ul>
</div>
</div>
<div class="about-the-site">
<div class="container">
<p class='blurb'>
<strong><a href=".">Devhints.io cheatsheets</a></strong> is a collection of cheatsheets I've written over the years.
Suggestions and corrections? <a href='https://github.com/rstacruz/cheatsheets/issues/907'>Send them in</a>.
<i class='fleuron'></i>
I'm <a href="http://ricostacruz.com">Rico Sta. Cruz</a>.
Check out my <a href="http://ricostacruz.com/til">Today I learned blog</a> for more.
</p>
<p class='back'>
<a class='big-button -back -slim' href='.#toc'></a>
</p>
<p>
</p>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/highlight.min.js"></script>
<script src="https://cdn.rawgit.com/rstacruz/unorphan/v1.0.1/index.js"></script>
<script>hljs.initHighlightingOnLoad()</script>
<script>unorphan('h1, h2, h3, p, li, .unorphan')</script>
</body>
</html>