拿掉 build files

This commit is contained in:
2022-07-18 16:33:23 +08:00
parent 41e2287bcb
commit 3707f158a3
31953 changed files with 0 additions and 4411796 deletions
-40
View File
@@ -1,40 +0,0 @@
'use strict'
const http = require('http')
const Youch = require('../src/Youch')
class HttpException extends Error {
constructor (...args) {
super(...args)
this.name = this.constructor.name
}
}
function foo () {
const error = new HttpException('Some weird error')
error.status = 503
throw error
}
http.createServer((req, res) => {
let youch = null
try {
foo()
} catch (e) {
youch = new Youch(e, req)
}
youch
.toHTML()
.then((response) => {
res.writeHead(200, {'content-type': 'text/html'})
res.write(response)
res.end()
}).catch((error) => {
res.writeHead(500)
res.write(error.message)
res.end()
})
}).listen(8000, () => {
console.log('listening to port 8000')
})