New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

blog

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blog - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

content/404.md

7

index.js
var routes = { index : require('./lib/index')
, error : require('./lib/error')
, js : require('./lib/sendfile')
, css : require('./lib/sendfile')
, images : require('./lib/sendfile')
}

@@ -11,3 +13,4 @@

if (route == undefined) {
route = routes['error']
route = routes['index']
path[2] = path[1]
}

@@ -19,3 +22,3 @@

function split_params (params) {
if (params == undefined) {
if (params == undefined || params == '/') {
return ['','index']

@@ -22,0 +25,0 @@ }

module.exports = reroute
var template = require('./template')
, md = require("github-flavored-markdown").parse
, fs = require('fs')
, siteConfig = require('./siteConfig')

@@ -10,3 +13,20 @@ function reroute (req, res, path) {

function view (req, res, path) {
res.send(template.process('index', {title: 'Thom Blake - Computer Ethics'}))
var name = path[2] || 'index'
, filename = siteConfig.contentRoot + '/' + name + '.md'
, content
try {
content = fs.readFileSync(filename, 'utf8')
}
catch (e) {
}
if (!content) {
filename = siteConfig.contentRoot + '/404.md'
content = fs.readFileSync(filename, 'utf8')
}
res.send(template.process('index', { title: 'Thom Blake - Computer Ethics'
, root: '/blog'
, content: md(content)
} ))
}

@@ -7,2 +7,3 @@ module.exports = reroute

, css : 'css/'
, images : 'images'
}

@@ -22,4 +23,4 @@

else {
res.sendfile(siteConfig.htdocsRoot + route + filename.input)
res.sendfile(siteConfig.htdocsRoot + '/' + route + filename.input)
}
}

@@ -0,5 +1,12 @@

var path = require('path')
, siteRoot = path.resolve(__dirname, '..')
, templateRoot = path.resolve(siteRoot, 'templates')
, htdocsRoot = path.resolve(siteRoot, 'htdocs')
, contentRoot = path.resolve(siteRoot, 'content')
module.exports =
{ siteRoot: '/m/nserver/blog/'
, templateRoot: this.siteRoot + 'templates/'
, htdocsRoot: this.siteRoot + 'htdocs/'
{ siteRoot: siteRoot
, templateRoot: templateRoot
, htdocsRoot: htdocsRoot
, contentRoot: contentRoot
}

@@ -9,7 +9,2 @@ var siteConfig = require('./siteConfig')

, error : function() { return '404 not found' }
, bugs : function() { return readTemplate('bugs') }
, ingredients : function() { return readTemplate('ingredients') }
, lists : function() { return readTemplate('lists') }
, recipes : function() { return readTemplate('recipes') }
, units : function() { return readTemplate('units') }
}

@@ -27,3 +22,3 @@

function readTemplate (name) {
var filename = siteConfig.templateRoot + name + '.jt'
var filename = siteConfig.templateRoot + '/' + name + '.jt'
return fs.readFileSync(filename, 'utf8')

@@ -30,0 +25,0 @@ }

@@ -5,3 +5,3 @@ { "name": "blog"

, "keywords" : [ "nserver", "blog" ]
, "version" : "0.0.2"
, "version" : "0.0.3"
, "repository" :

@@ -20,3 +20,4 @@ { "type" : "git"

, "nserver-util" : "*"
, "github-flavored-markdown" : "*"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc