Skip to content

Commit

Permalink
Merge pull request #551 from wpreul/feature/examples
Browse files Browse the repository at this point in the history
Adding favicon example
  • Loading branch information
Eran Hammer committed Feb 18, 2013
2 parents f567745 + 66a825f commit 2246111
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Binary file added examples/favicon.ico
Binary file not shown.
26 changes: 26 additions & 0 deletions examples/favicon.js
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit 2246111

Please sign in to comment.