NodeAtlas

CLI / Running commands

The easiest way to start is to position NodeAtlas in the directory hosting your site and run the command \> node </path/to/>node-atlas/. However there are options to launch more than launch the site.

Each of the commands that follow can be coupled with other like this:

\> node </path/to/>node-atlas/ --directory /hello-world/ --webconfig config.fr-fr.js --httpPort 80 --browse

--directory <path>

It is possible to launch NodeAtlas from another location where the website folder is placed. The --directory command will be very useful.

\> node </path/to/>node-atlas/ --directory </path/to/your/website/directory/>

--webconfig <webconfigName>

By default, NodeAtlas will read your webconfig.json file. It is possible that in addition to the file you created another webconfig.prod.json file whose domain name is different. Or a webconfig.fr-fr.json with urls changes for another language. Instead of renaming your files in webconfig.json before launching the site, simply enter your other configuration name. In the following example, this file will be webconfig.alternatif.json.

\> node </path/to/>node-atlas/ --webconfig webconfig.alternatif.json

--browse [subpath]

This command opens your browser to the address on which the site will run. Very handy when you do not remember the port for your development version. This command is useless if it is coupled with --generate (see below).

\> node </path/to/>node-atlas/ --browse

You could also targeted a specific page with the end of url.

\> node </path/to/>node-atlas/ --browse index.html

--httpHostname <httpHostname>

You will maybe want know your IP with ipconfig to change it in the url to access your website from others device connected to the current network so this command is for you.

\> node </path/to/>node-atlas/ --httpHostname 192.168.1.1

--httpPort <httpPort>

You will not be bored to change your listening port on your projects and sometimes you'll have to work on two different websites simultaneously. With this command you will not need to cut your sites turn to release the listener, simply pick one at launch.

\> node </path/to/>node-atlas/ --httpPort 7778

--generate

If you change an item in your common variation file or even your template components called in multiple pages, you will not reload each page to update your output files. If so, simply use --generate. This command will copy the entire contents of the folder assetsRelativePath into generatesRelativePath if their path is different.

\> node </path/to/>node-atlas/ --generate

--lang <culture-country>

With the --lang parameter you will change language used by NodeAtlas. This command set the content of languages/default.json by the content of languages/fr-fr.json if you use the "fr-fr" parameter for example like below. Start NodeAtlas later will conserve the last language used by engine.

\> node </path/to/>node-atlas/ --lang fr-fr

--init [path]

NodeAtlas contain a directory templates with predefined website into. To install them in the current directory for NodeAtlas command, you can use --init with the name of the templates you want use. By default, it's the hello-world value that is used. Possible values: hello-world.

\> node </path/to/>node-atlas/ --init hello-world

--httpSecure [pathName]

If you use the --httpSecure option, all path will be reach in HTTPs. You must defined a .crt and .key files with pathName if you want the engine start in HTTPs. For exemple if you have security/server.crt and security/server.key from root of NodeAtlas website, you can use following command:

\> node </path/to/>node-atlas/ --httpSecure security/server