Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mircea Danila Dumitrescu committed May 16, 2014
1 parent e1c0d61 commit 17f5582
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ lib
node_modules
tmp
public/lib
public/views/*.html
public/views/includes/*.html

26 changes: 14 additions & 12 deletions bin/viewServer.js → bin/webServer.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
"use strict";
var express = require('express'),
util = require('util'),
path = require('path'),
http = require('http'),
fs = require('fs'),
app = express(),
port = 3001;
port = 3001,
i;

app.use("/", express.static('public'));
// env

app.set('port', process.env.port || port);
app.set('views', path.join(__dirname, '/public/views'));
app.set('view engine', 'jade');
//app.use(express.bodyParser());
app.disable('x-powered-by');

/**
* route
*/
//routes
app.get('/', function (req, res) {
res.render('overview', {title: 'overview'});
});
Expand All @@ -27,17 +26,20 @@ app.get('/:page', function (req, res) {
res.render(page, {title: page});
});

/**
* read fs
*/
fs.readdirSync('public').forEach(function (file) { // iterate through every sub-folder
if (!file.match(/(\.ico$|views)/)) {
app.use(express.static('public/' + file));
//public dir
fs.readdir("public", function (err, files) {
if (err) {
throw err;
}
for (i = 0; i < files.length; i++) {
if (!files[i].match(/(\.ico$|views)/)) {
app.use(express.static('public/' + files[i]));
}
}
});

(function () {
http.createServer(app).listen(app.get('port'), function (req, res) {
util.log('View server listening on port ' + port);
});
})();
}());
1 change: 0 additions & 1 deletion public/views/404.html

This file was deleted.

1 change: 0 additions & 1 deletion public/views/includes/content.html

This file was deleted.

1 change: 0 additions & 1 deletion public/views/index.html

This file was deleted.

1 change: 0 additions & 1 deletion public/views/layout.html

This file was deleted.

1 change: 0 additions & 1 deletion public/views/overview.html

This file was deleted.

1 change: 0 additions & 1 deletion public/views/real-time.html

This file was deleted.

1 change: 0 additions & 1 deletion public/views/report.html

This file was deleted.

1 change: 0 additions & 1 deletion public/views/test.html

This file was deleted.

Loading

0 comments on commit 17f5582

Please sign in to comment.