Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var express = require('express');
var http = require('http');
var path = require('path');
var bloggy = require('../../lib/bloggy')
var app = express();
// Some expressjs stuff
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
app.use(express.errorHandler());
// Create bloggy engine
var engine = bloggy();
// Configure bloggy engine
engine.extendWith(require('bloggy-query'));
engine.extendWith(require('bloggy-marked'));
engine.setup({
baseDirectories: [path.join(__dirname, 'content')],
entryUrl: 'http://localhost:' + app.get('port') + '/blog/{slug}'
});
app.get('/', function(req, res) {
var entries = engine.entries.all.orderedByDate();
app.configure('development', function() {
app.use(express.static(pub));
app.use(express.errorHandler({
dumpExceptions: true,
showStack: true
}));
});
http.configure("development", function () {
http.use(express.errorHandler());
});
kickstart.srv.configure('production', function(){
kickstart.srv.use(express.errorHandler());
});
app.configure('production', function(){
app.use(resmin.middleware(express, pubDir, resminConfig));
var oneYear = 31557600000;
app.use(express.static(pubDir, { maxAge: oneYear }));
app.use(express.errorHandler());
});
app.configure('development', function(){
app.use(express.errorHandler());
});
app.configure('development', function(){
app.use(express.errorHandler());
});
app.configure('production', function(){
app.use(express.errorHandler());
});
app.configure('development', function(){
app.use(express.errorHandler());
});