Skip to content

Instantly share code, notes, and snippets.

@mlouro
Created April 1, 2011 15:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlouro/898319 to your computer and use it in GitHub Desktop.
Save mlouro/898319 to your computer and use it in GitHub Desktop.
JSHINT Node.js app and rules
var express = require('express')
var app = express.createServer();
var JSHINT = require('jshint').JSHINT;
app.use(express.bodyParser());
app.get('/', function(req, res){
res.send('hello world');
});
app.post('/', function(req, res){
results = JSHINT(req.body.doc, {
eqeqeq: true,
forin: true,
immed: true,
newcap: true,
noempty: true,
undef: true,
strict: true,
white: true
});
res.send(JSHINT.data());
});
app.listen(8081);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment