Socket
Socket
Sign inDemoInstall

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


Version published
Weekly downloads
15
increased by25%
Maintainers
1
Weekly downloads
 
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');
		}
	}
}

Keywords

FAQs

Package last updated on 13 Jun 2016

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