Add dev script
This commit is contained in:
parent
e8617a8af2
commit
ff9e31f0c4
4 changed files with 39 additions and 1 deletions
14
app.js
Normal file
14
app.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
var serveStatic = require('serve-static')
|
||||
var http = require('http')
|
||||
var fs = require('fs')
|
||||
|
||||
var notfound = fs.readFileSync('404.dev.html')
|
||||
|
||||
http.createServer(function (req, res) {
|
||||
serveStatic('.')(req, res, function () {
|
||||
res.writeHead(404, { 'Content-Type': 'text/html' })
|
||||
res.end(notfound)
|
||||
})
|
||||
}).listen(3000)
|
||||
|
||||
console.log(`\nListening at http://localhost:3000\n`)
|
||||
Loading…
Add table
Add a link
Reference in a new issue