Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clout-js

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clout-js

Clean, simplistic, enterprise grade full-stack NodeJS framework

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Clout Javascript Framework

Install

$ npm install clout-js

Project Structure

/conf 			- contains configuration w/ support for NODE_ENV
/apis 			- contains apis for the application
/hooks			- hooks which can be invoked before an api
/models 		- contains models (native support for sequalize)
/public 		- public folder
/controllers 	- contains controllers for application

Usage

app.js example

var clout = require('clout-js');

clout.on('started', function () {
	if (clout.server.https) {
		console.info('http server started on port %s', clout.server.https.address().port);
	}
	if (clout.server.http) {
		console.info('http server started on port %s', clout.server.http.address().port);
	}
});

clout.app.use(function (req, res, next) {
	next();
});

clout.start();

/api/ping.js example

var clout = require('clout-js');

module.exports = {
	list: {
		path: '/ping',
		description: 'ping service',
		method: 'get',
		fn: function get(req, res) {
			res.ok('GET REQUEST');
		}
	},
	publish: {
		path: '/ping',
		description: 'ping service',
		method: 'post',
		// hooks: [ auth.isLoggedIn() ],
		fn: function post(req, res) {
			res.ok('POST REQUEST');
		}
	}
}

Enviromental Config

  • development (DEFAULT)

These enviromental variable can be set using NODE_ENV=.

These configuration files can be stored in /conf with ..js with default..js always

Keywords

FAQs

Package last updated on 06 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc