2.1.0-beta.7 • Published 4 years ago

clout-js v2.1.0-beta.7

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

Clout Javascript Framework NPM version Build Status

The Vision

Having developed many server-side services using a wide range of enterprise and open-source frameworks, I realized all of them had one thing in common. They all pushed you to use certain technologies in certain ways.

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.

Install

$ npm install clout-js@beta --save

Development

These commands should be run in this directory.

Run tests

$ npm run test
$ npm run test:watch

Create documentation

$ npm run gendoc

Run application with this instance

$ APPLICATION_PATH=<clout-js-applcation> npm run start

Usage

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.

Directorypurpose
/confcontains configuration w/ support for NODE_ENV
/apiscontains apis for the applicationCreate API Endpoint
/hookshooks which can be invoked before an api
/modelscontains models (native support for sequalize)
/publicpublic assets folder
/controllerscontains 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

Clout-JS Module List

package-namedescription
clout-redis-sessionClout module to leverage Redis for sessions
clout-passportClout module to implement passport
clout-parseParse module
clout-mongooseClout module to leverage mongoose for models
clout-18nClout module to implement i18n
clout-socket-ioClout module to leverage socket.io
clout-sequelizeClout module to leverage sequelize for models
clout-flashFlash message middleware module for Clout-JS
2.1.0-beta.7

4 years ago

2.1.0-beta.6

4 years ago

2.1.0-beta.5

4 years ago

2.1.0-beta.3

4 years ago

2.1.0-beta.4

4 years ago

2.1.0-beta.2

5 years ago

2.1.0-beta.1

6 years ago

2.0.0-beta.7

6 years ago

2.0.0-beta.6

6 years ago

2.0.0-beta.5

6 years ago

2.0.0-beta.4

6 years ago

2.0.0-beta.3

6 years ago

2.0.0-beta.2

6 years ago

2.0.0-beta.1

6 years ago

2.0.0-alpha.1

6 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.2

8 years ago

1.0.0

8 years ago

0.1.1

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago