Skip to content

Commit

Permalink
even more readability
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanmik committed Dec 17, 2013
1 parent 44e1da1 commit 31daf8e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var express = require('express'),
app = module.exports = express(),
config = require('./config'),
config = require('./config'),
fileModule = require('file'),
cache = require('./lib/cache'),
cors = require('./lib/cors'),
Expand Down Expand Up @@ -35,20 +35,20 @@ app.use(cache());
* Set up endpoints
*/
fileModule.walkSync('./endpoints', function iterateEndpoints(dirPath, dirs, endpoints) {
if (endpoints && dirPath.indexOf("/test") < 0) endpoints.forEach( requireEndpoint );
if (endpoints && dirPath.indexOf('/test') < 0) endpoints.forEach(requireEndpoint);

function requireEndpoint (endpoint) {
function requireEndpoint(endpoint) {
if (endpoint.indexOf('.DS_Store') === -1) require('./' + dirPath + '/' + endpoint);
}
});

/**
* Start the server
*/
app.listen(config.port,function() {
app.listen(config.port, function () {
app.emit('ready');
});

app.on('ready',function() {
app.on('ready', function () {
if (!config.testing) console.log('Server running at port: ' + config.port);
});

0 comments on commit 31daf8e

Please sign in to comment.