Skip to content

Commit

Permalink
remove outdated render function
Browse files Browse the repository at this point in the history
  • Loading branch information
dhershman1 committed Jan 9, 2020
1 parent c74d560 commit 7704294
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions lib/response/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const fs = require('fs')
const encodeUrl = require('encodeurl')
const Buffer = require('safe-buffer').Buffer
const { and, type } = require('kyanite')
Expand Down Expand Up @@ -75,27 +74,8 @@ function send (code, data) {
}
}

function render (htmlPath) {
return function ({ response, logger }) {
return fs.readFile(htmlPath, (err, data) => {
if (err) {
logger.error(err)

response.writeHead(500, { 'Content-Type': 'text/html' })

return response.end('Something went wrong!')
}

response.writeHead(200, { 'Content-Type': 'text/html', 'Content-Length': data.length })

return response.end(data)
})
}
}

module.exports = {
json: _curry2(json),
redirect: _curry2(redirect),
send: _curry2(send),
render
send: _curry2(send)
}

0 comments on commit 7704294

Please sign in to comment.