Sha256: f09084235d3aa68d1874431c99eb8d2653f388597cffb620bfe1c465e3efd69d

Contents?: true

Size: 1.46 KB

Versions: 11

Compression:

Stored size: 1.46 KB

Contents

'use strict';
// This file create a small node server so 
// you view the files over http://localhost:3009/
// enter in commandline - $ node app
// Glenn Jones


var Hapi            = require('hapi'),
    Blipp           = require('blipp'),
    Pack            = require('./package');
    
    
var routes = [{
	method: 'GET',
	path: '/{path*}',
	handler: {
		directory: {
			path: '/tests',
			listing: true,
			index: false
		}
	}
},{
	method: 'GET',
	path: '/css/{path*}',
	handler: {
		directory: {
			path: './css',
			listing: true,
			index: true
		}
	}
},{
	method: 'GET',
	path: '/javascript/{path*}',
	handler: {
		directory: {
			path: './javascript',
			listing: true,
			index: true
		}
	}
}];    
    


// Create a server with a host and port
var server = new Hapi.Server();

server.connection({ 
    host: (process.env.PORT)? '0.0.0.0' : 'localhost', 
    port: parseInt(process.env.PORT, 10) || 3008
});


// hapi server settings
server.route(routes);


var goodOptions = {
    opsInterval: 1000,
    reporters: [{
        reporter: require('good-console'),
        events: { log: '*', response: '*' }
    }]
};



// Register plug-in and start
server.register([{
    register: require('good'), 
    options: goodOptions
  },{
    register: require('blipp'), 
  }], function (err) {
      if (err) {
          console.error(err);
      }else {
          server.start(function () {
              console.info('Server started at ' + server.info.uri);
          });
      }
  });

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
microformats-4.0.7 vendor/tests/app.js
microformats-4.0.6 vendor/tests/app.js
microformats-4.0.5 vendor/tests/app.js
microformats-4.0.4 vendor/tests/app.js
microformats-4.0.3 vendor/tests/app.js
microformats-4.0.2 vendor/tests/app.js
microformats-4.0.1 vendor/tests/app.js
microformats-4.0.0 vendor/tests/app.js
microformats2-3.1.0 vendor/tests/app.js
microformats2-3.0.1 vendor/tests/app.js
microformats2-3.0.0 vendor/tests/app.js