Deploying Cogear.JS-generated site to the Now.sh

dbelyaeff

Dmitriy Belyaev

Posted on October 5, 2018

Deploying Cogear.JS-generated site to the Now.sh

Cogear.JS is an open-sourcered static websites generator built with Node.JS and based on the latest Webpack.

Dev.to members previously may read the introduction article and the tutorial about how to create a blog in a minutes with Cogear.JS.

Now it's time to talk about deploy.

When a site is designed in development mode and built-in production or build mode, it's time to deploy it to the remote server.

Basically Cogear.JS can upload it via FTP or SFTP protocols and even use rsync (if installed).

Deploy methods speed comparsion:

    Method          Speed    
FTP slowest
SFTP fast
rsync fastest

You can read more about standard deploy ops in the docs:
https://cogearjs.org/docs/deploy

But now it's all about Now.sh which provides free hosting for static sites.

Getting Started

You need to download and install desktop Now.sh app. It will provide command line utility called now.

When it has been installed deploy procedure becomes incredibly easy.

Just compile your site (build it):

$ cd ~/Sites/site

$ cogear build
Enter fullscreen mode Exit fullscreen mode

It will be compiled to the output folder which is ./public by default.

Now you are ready to deploy.

$ now --public public
Enter fullscreen mode Exit fullscreen mode

You send the command to Now to upload the folder ./public in --public mode (it's required for non-paid accounts).

Within a few seconds, your site is online!

Site address has been copied to the clipboard.

You may choose an appropriate domain with now alias command.

$ now alias https://public-psuaoefsus.now.sh cogear.now.sh
Enter fullscreen mode Exit fullscreen mode

Done!

You can even use custom domain via DNS management.

Like I do:

$ now alias https://public-psuaoefsus.now.sh cogearjs.org
Enter fullscreen mode Exit fullscreen mode

Read more

Cogear.JS official site is hosted at Now.sh absolutely for free.

💖 💪 🙅 🚩
dbelyaeff
Dmitriy Belyaev

Posted on October 5, 2018

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related