docsify/app.js
2016-11-27 13:09:18 +08:00

13 lines
353 B
JavaScript

var serveStatic = require('serve-static')
var http = require('http')
var fs = require('fs')
http.createServer(function (req, res) {
serveStatic('.')(req, res, function () {
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end(fs.readFileSync('404.dev.html'))
})
}).listen(3000)
console.log(`\nListening at http://localhost:3000\n`)