DEV Community

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

Posted on

3 2

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.

Billboard image

Deploy and scale your apps on AWS and GCP with a world class developer experience

Coherence makes it easy to set up and maintain cloud infrastructure. Harness the extensibility, compliance and cost efficiency of the cloud.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay