0.0.242 • Published 10 years ago

cyrus v0.0.242

Weekly downloads
3
License
-
Repository
github
Last release
10 years ago

Cyrus

NPM

CyrusJS is an implementation or wrapper for the ExpressJS framework. Cyrus was created with the intention to assist in the rapid deployment of standardized web applications and provide a small level of convention over configuration such as auto-loading controllers. Cyrus is configuration file driven and is easy to setup environments for multiple developers and servers. The Cyrus Generator The goal was to assist developers and teams in creating consistent code bases for multiple modules or applications accross time, thereby creating a more devloper friendly environment and making future development, patching and training easier and more cost effective.

Disclaimer

Cyrus is being used in multiple applications in production, but I would recommend making sure you tie your project to a specific release. If you are interested in making any sugesttions please fork and submit a pull request and I will merge as quickly as possible.

Getting Started

Cyrus can very easily be used on it's own, however using the yeoman generator will fully and correctly stub out a working example site. The generated code is very lightweight and will give you a running site in about 1 minute.

Visit The Cyrus Generator For Full Documentation

Config File Properties

PropertyOpt?DefaultDescription
sslyesFalseRun the app in https mode?
app_modeNone-2 (test), -1 (dev), 0 (stage), 1 (production)
server_portNonePort to run webserver on
public_folderyespublicAbsolute path to public folder
controllers_folderyesapp/controllerAbsolute path to controllers folder (recursive)
model_rootyesapp/modelAbsolute path to models folder
views_folderyesapp/viewAbsolute path to views folder
view_engineyesjadeView engine, Express property
enable_js_middlewareyesFalseEnable the JS middleware inline pre-compiler
js_folderyesapp/resources/jsAbsolute path to raw javascript folder
enable_less_middlewareyesFalseEnable the JS middleware inline pre-compiler
less_folderyesapp/resources/lessAbsolute path to raw LESS folder
cookie_secretExpress Middleware Cookie Secret
session_secretExpress Middleware Session Secret
mongooseyes{}Mongoose connection properties. See example
redisyes{}Redis connection properties. See example
mysqlyes{}MySql connection properties. See example
mailserveryes{}Mail Server properties. See example

Config File Example

var path = require('path')

exports.load = function(appRoot) {
    var config = {};

    config["ssl"] = false;
    config["app_mode"] = -1; // -2=test, -1=dev, 0=stage, 1=production

    config["server_port"] = 8000;

    config["public_folder"] = path.resolve("./client/public");
    config["controllers_folder"] = path.resolve("./server/controller");
    config["model_root"] = path.resolve("./lib/model");

    config["view_engine"] = "jade";
    config["views_folder"] = path.resolve("./client/view");

    config["enable_js_middleware"] = true;
    config["js_folder"] = path.resolve("./client/resources/js");

    config["enable_less_middleware"] = true;
    config["less_folder"] = path.resolve("./client/resources/styles");

    config["cookie_secret"] = "Xv2Irkb7SfsPhz-AQ-33xGdIqFslrf5uE9N";
    config["session_secret"] = "1440qWCyzQr_82w275wPX1LPodLSZK0EhyR";

    config["mongoose"] = {
          "connection": "mongodb://localhost/myapp_io"
        , "store_sessions": false
    };

    config["mysql"] = {
        "host": '127.0.0.1',
        "user": 'jonny5',
        "password": '3@8721^$324#',
        "database": 'myapp_io',
        "connectionLimit": 10 // ConnectionLimit will force the use of the MySQL pool
    };

    config["redis"] = {
            "host": "127.0.0.1"
          , "port": 6379
    };

    config["mailserver"] = {
          "host": "mailtrap.io"
        , "port": 465
        , "secureConnection": false
        , "auth": {
              "user": "192328c6d3465317b"
            , "pass": "1e0e737a891852"
        }
    };

    // You can also write functions inside your configuration
    config["getModel"] = function(model) {
        return require(path.join(path.resolve("./lib/model"), model + ".js"));
    }


    return config;
}
0.0.243

10 years ago

0.0.242

10 years ago

0.0.241

10 years ago

0.0.235

10 years ago

0.0.234

10 years ago

0.0.233

10 years ago

0.0.232

10 years ago

0.0.231

10 years ago

0.0.230

10 years ago

0.0.229

10 years ago

0.0.228

10 years ago

0.0.2271

10 years ago

0.0.227

10 years ago

0.0.226

10 years ago

0.0.225

10 years ago

0.0.224

10 years ago

0.0.223

10 years ago

0.0.221

10 years ago

0.0.22

10 years ago

0.0.21

10 years ago

0.0.2

10 years ago