Clean, simplistic, enterprise grade full-stack NodeJS framework
npm install clout-jsClout Javascript Framework [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
===========
It all came down to going back to the basics and using express to build any project. Each project had slight variations in packages and thus came the concept of clout-js. A de-coupled event based frameworks that allows you to use whatever technology you would like to use. Modules can be packaged up and re-used in different projects. Even the core-modules such as starting the server could be replaced by writing an override.
bash
$ npm install clout-js@beta --save
`Development
These commands should be run in this directory.$3
`bash
$ npm run test
$ npm run test:watch
`$3
`bash
$ npm run gendoc
`$3
`bash
$ APPLICATION_PATH= npm run start
`Usage
`node
const clout = require('clout-js');clout.start();
clout.on('started', () => {
['https', 'http'].forEach((key) => {
let server = clout.server[key];
if (server) {
let port = server.address().port;
console.info('%s server started on port %s', key, port);
}
});
});
`Clout Application Loader default paths
The following folders are default application searchpath.| Directory | purpose |
| ------------- | :------------------------------------------------ |
| /conf | contains configuration w/ support for NODE_ENV |
| /apis | contains apis for the application | Create API Endpoint
| /hooks | hooks which can be invoked before an api |
| /models | contains models (native support for sequalize) |
| /public | public assets folder |
| /controllers | contains controllers for application |
Enviromental Config
`NODE_ENV=development npm run start`You can load different configuration files depending on the env variables. For example, the usage of
`NODE_ENV=development` (default) would load the following configuration files into the application;
- `conf/default.js`
- `conf/**.development.js`
- `conf/development.js`Another example is
`NODE_ENV=production` which would load the following files;
- `conf/default.js`
- `conf/**.production.js`
- `conf/production.js``[npm-image]: https://badge.fury.io/js/clout-js.svg
[npm-url]: https://npmjs.org/package/clout-js
[travis-image]: https://travis-ci.org/clout-stack/clout-js.svg?branch=master
[travis-url]: https://travis-ci.org/clout-stack/clout-js