diff --git a/.gitignore b/.gitignore index 77ba16cb0..7e1574dc5 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,4 @@ config.json */*/._* coverage.* lib-cov - +complexity.md diff --git a/Makefile b/Makefile index 1fdc83900..c50f99a6e 100755 --- a/Makefile +++ b/Makefile @@ -9,4 +9,7 @@ test-cov: test-cov-html: @NODE_ENV=test ./node_modules/.bin/mocha --require blanket --recursive --ignore-leaks --timeout 3000 -R html-cov > coverage.html +complexity: + ./node_modules/.bin/cr -o complexity.md -f markdown lib + .PHONY: test test-cov test-cov-html diff --git a/examples/favicon.ico b/examples/favicon.ico new file mode 100644 index 000000000..28e95e372 Binary files /dev/null and b/examples/favicon.ico differ diff --git a/examples/favicon.js b/examples/favicon.js new file mode 100644 index 000000000..d10ddbc6d --- /dev/null +++ b/examples/favicon.js @@ -0,0 +1,26 @@ +// Example serves a favicon.ico file that is cached on the client for a day + +// Load modules + +var Hapi = require('../lib'); + + +// Declare internals + +var internals = {}; + + +internals.main = function () { + + var http = new Hapi.Server(8080); + + http.route([ + { method: 'GET', path: '/favicon.ico', handler: { file: './favicon.ico' }, config: { cache: { mode: 'client', expiresIn: 86400000, privacy: 'public' } } } + ]); + + http.start(); +}; + + +internals.main(); + diff --git a/package.json b/package.json index 083b9bd03..b46170dec 100755 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "handlebars": "1.0.x", "jade": "0.28.x", "blanket": "1.0.x", - "travis-cov": "0.2.x" + "travis-cov": "0.2.x", + "complexity-report": "0.x.x" }, "scripts": { "test": "make test && make test-cov",