Deploy Site.js version 14.6.0

parent 5f9fb2cc
module.exports = (request, response) => { response.end('20200827134854') }
module.exports = (request, response) => { response.end('20200827160214') }
......@@ -380,10 +380,10 @@
</p>
<h4 class='no-js'>Linux and macOS</h4>
<pre class='linux macos'><code class='language-mixed'><span class='language-bash'>echo '</span><span class='language-js'>i=0; module.exports=(_, r)=>{r.type("html").end(`${++i}`)}</span><span class='hljs-string'>'</span><span class='language-bash'> > index.js</span></code></pre>
<pre class='linux macos'><code class='language-mixed'><span class='language-bash'>echo '</span><span class='language-js'>i=0; module.exports=(_, res) => res.html(`${++i}`)</span><span class='hljs-string'>'</span><span class='language-bash'> > index.js</span></code></pre>
<h4 class='no-js'>Windows</h4>
<pre class='windows'><code class='language-mixed'><span class='language-powershell'>echo '</span><span class='language-js'>i=0; module.exports=(_, r)=>{r.type("html").end(`${++i}`)}</span><span class='hljs-string'>'</span><span class='language-powershell'> | Out-File -Encoding UTF8 index.js</span></code></pre>
<pre class='windows'><code class='language-mixed'><span class='language-powershell'>echo '</span><span class='language-js'>i=0; module.exports=(_, res) => res.html(`${++i}`)</span><span class='hljs-string'>'</span><span class='language-powershell'> | Out-File -Encoding UTF8 index.js</span></code></pre>
<aside>
<h3>Tip</h3>
......@@ -418,9 +418,7 @@
<pre><code class='language-js'>let counter = 0
module.exports = (request, response) => {
response
.type('html')
.end(`&lt;h1&gt;Hit count: ${++counter}&lt;/h1&gt;`)
response.html(`&lt;h1&gt;Hit count: ${++counter}&lt;/h1&gt;`)
}</code></pre>
<p>
If this reminds you of a route in <a href='https://expressjs.com'>Express</a>, that’s because that’s exactly what it is.
......@@ -428,6 +426,9 @@ module.exports = (request, response) => {
<p>
The only difference is that you don’t have to write any other code or worry about anything else including installing Node.js, provisioning TLS certificates, ensuring your site automatically restarts on reboots, etc.
</p>
<p>
(Also, you might not recognise the `.html()` method on the `response` object as that’s a Site.js addition to make your life easier. It corresponds to writing `.type('html').end()` in Express.)
</p>
<p>
Site.js does not limit you to using DotJS. If you want to, you can use the full power of Express and Node.js with <a href='https://github.com/small-tech/site.js#advanced-routing-routesjs-file'>advanced routing</a>. And, since it is just Node.js under the hood, you can do anything you can with Node.js including <a href='https://github.com/small-tech/site.js#using-node-modules'>using node modules</a>, etc.
</p>
......
......@@ -45,9 +45,9 @@ betaBinaryVersion=20200710135219
betaPackageVersion=14.1.1
betaSourceVersion=afde7bd
releaseBinaryVersion=20200827134854
releasePackageVersion=14.5.3
releaseSourceVersion=305cbbc
releaseBinaryVersion=20200827160214
releasePackageVersion=14.6.0
releaseSourceVersion=c7c49a3
binaryVersionVariableName="${releaseChannel}BinaryVersion"
packageVersionVariableName="${releaseChannel}PackageVersion"
......
##########################################################################################
#
# Site.js 20200827134854 (14.5.3/305cbbc) Installer for Windows 10 (PowerShell)
# Site.js 20200827160214 (14.6.0/c7c49a3) Installer for Windows 10 (PowerShell)
#
# To use:
#
......@@ -23,7 +23,7 @@ $installationScriptUrl = 'https://sitejs.org/install.txt'
$installationScriptFileName = 'install-site.js.ps1'
# The address to download the tar-gzipped archive of the Site.js binary from.
$archiveUrl = 'https://sitejs.org/binaries/release/windows/20200827134854.tar.gz'
$archiveUrl = 'https://sitejs.org/binaries/release/windows/20200827160214.tar.gz'
# Emoji encodings (because Powershell is from the Stone Age and cannot handle
# emoji literals in strings)
......@@ -86,7 +86,7 @@ if (!([Security.Principal.WindowsPrincipal] `
# Installer is running with regular privileges. Start a new PowerShell session with elevated privileges.
#
Write-Output ''
Write-Output " $satelliteEmoji Downloading Site.js 20200827134854 (14.5.3/305cbbc)$ellipsis"
Write-Output " $satelliteEmoji Downloading Site.js 20200827160214 (14.6.0/c7c49a3)$ellipsis"
# We need to start a new PowerShell session with elevated privileges but if we're running in memory
# only after being downloaded by the installation command, we don't have a copy of ourselves to run.
......@@ -112,16 +112,16 @@ if (!([Security.Principal.WindowsPrincipal] `
Write-Output "`n`n`n`n`n`n"
Write-Output ' Installing Site.js using administrator privileges...'
Write-Output ''
Write-Output ' * Downloading Site.js 20200827134854 (14.5.3/305cbbc)...'
Write-Output ' * Downloading Site.js 20200827160214 (14.6.0/c7c49a3)...'
# Download the latest Site.js archive.
Invoke-WebRequest -Uri $archiveUrl -OutFile '20200827134854.tar.gz'
Invoke-WebRequest -Uri $archiveUrl -OutFile '20200827160214.tar.gz'
Write-Output ''
Write-Output ' * Extracting binary...'
# Gunzip and untar the binary.
tar -xf 20200827134854.tar.gz
tar -xf 20200827160214.tar.gz
Write-Output ''
Write-Output ' * Installing binary...'
......
{
"name": "site.js-site",
"version": "14.5.3",
"version": "14.6.0",
"description": "",
"main": "index.js",
"scripts": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment