DEV Community

Cover image for Deploying Cogear.JS-generated site to the Now.sh
Dmitriy Belyaev for Cogear.JS

Posted on

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

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

Now you are ready to deploy.

$ now --public public

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

Done!

You can even use custom domain via DNS management.

Like I do:

$ now alias https://public-psuaoefsus.now.sh cogearjs.org

Read more

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

Top comments (0)