Node Atlas NodeAtlas

The Progressive Server-side JavaScript Framework

  • Simple set-up

    You know HTML & CSS?
    But not JavaScript?

    Quickly create multilingual websites effortlessly with simple routes, views or variations.

  • Scalable website

    JavaScript client-side Expert?
    Ready to embrace Node.js?

    Gradually improve your base as you need by using controllers, models or modules.

  • Agnostic client side

    Already your Front-end habits?
    You use Data Binding?

    From Vanilla to jQuery and going through Vue, Angular or React: use your favorite tools!

API / NodeAtlas as npm module

You could run NodeAtlas via JavaScript code.

All private functions, modules and namespacese are explained here la documentation de l'API. For the Hooks it's here and for server start fonctions it's below :

<NA>.start()

Execute a simple NodeAtlas running with start(). By default, it use webconfig.json from directory where file is executed. If no webconfig.json is set, a Simple Web Server will be launched.

server.js

require("node-atlas")().start();
$ server server.js
``



### &lt;NA>.init(options) ###

You can also configure the launch with `init(options)`:

*server.js*

```javascript
require("node-atlas")().init({
    path: "/path/to/your/website/directory/",
    webconfig: "webconfig.alternatif.json",
    browse: true,
    httpHostname: "192.168.1.1",
    httpPort: 7778,
    generate: true
}).start();
$ node server.js

The options object is the following:

{
    path: <string>,
    webconfig: <string>,
    browse: <boolean|string>,
    httpHostname: <string>,
    httpPort: <number>,
    generate: <boolean>,
    cache: <boolean>,
    lang: <string>,
    create: <string>,
    httpSecure: <boolean|string>
}

Note : more détails for each option in CLI part.

<NA>.run(options)

With run(options) you could configure and lanch NodeAtlas with one command.

You can for example run multiple websites in same time. Each webconfig must listen a different port.

servers.js

var nodeAtlas = require("node-atlas"),
    websiteEn = new nodeAtlas(),
    websiteFr = new nodeAtlas();

websiteEn.run({
    "browse": true,
    "webconfig": "webconfig.english.json"
});
websiteFr.run({
    "browse": true,
    "webconfig": "webconfig.french.json"
});

<NA>.started(callback)

With started(callback), you could also execute other tasks after server ran:

servers.js

require("node-atlas")().started(function() {
    console.log("Server started!");
}).run({
    browse: true
});

<NA>.stopped(callback)

With stopped(callback), you could also execute other tasks after server stopped:

servers.js

require("node-atlas")().stopped(function() {
    console.log("Server stopped!");
}).start();

<NA>.generated(callback)

With generated(callback), you could also execute other tasks after assets generation:

servers.js

require("node-atlas")().generated(function() {
    require('child_process').exec(__dirname + "/documentation.bat", function (err, stdout, stderr) {
        console.log("Documentation generation...");
        console.log(stdout);
        console.log("Documentation generation done !");
    });
}).run({
    generate: true
});

<NA>.created(callback)

With created(callback), you could also execute other tasks after init the current directory with template website:

servers.js

var nodeAtlas = require("node-atlas"),
    website = nodeAtlas();

website.init({
    "init": true
}).created(function() {
    website.run({
        "browse": true
    });
}).start();