Skip to content

Commit

Permalink
support for fastify 3
Browse files Browse the repository at this point in the history
  • Loading branch information
StarpTech committed Jul 11, 2020
1 parent 7fa1cca commit 8df77ba
Show file tree
Hide file tree
Showing 5 changed files with 3,242 additions and 20 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,5 @@ jspm_packages
# Optional npm cache directory
.npm

# npm lock
package-lock.json
yarn.lock

# Optional REPL history
.node_repl_history
4 changes: 2 additions & 2 deletions example.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const plugin = require('.')

fastify.register(plugin)

fastify.get('/', async function(req, reply) {
fastify.get('/', async function (req, reply) {
throw new Error('Opppps!')
})

fastify.listen(3000, err => {
fastify.listen(3000, (err) => {
if (err) throw err
console.log('Server listenting on localhost:', fastify.server.address().port)
})
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function fastifyErrorPage(fastify, options, next) {
fastify.setErrorHandler((err, req, reply) => {
try {
const youch = new Youch(err, req.raw)
youch.toHTML().then(html => {
youch.toHTML().then((html) => {
reply.type('text/html')
reply.send(html)
})
Expand All @@ -20,6 +20,6 @@ function fastifyErrorPage(fastify, options, next) {
}

module.exports = fp(fastifyErrorPage, {
fastify: '^2.x.x',
fastify: '^3.x.x',
name: 'fastify-error-page'
})
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@
},
"homepage": "https://github.com/hemerajs/fastify-error-page#readme",
"dependencies": {
"fastify-plugin": "^1.5.0",
"fastify-plugin": "^2.0.0",
"youch": "^2.0.10"
},
"devDependencies": {
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint": "^7.4.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-hemera": "^1.0.0",
"eslint-config-prettier": "^4.2.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-mocha": "^5.3.0",
"eslint-plugin-node": "^9.0.1",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-promise": "^4.1.1",
"fastify": "^2.3.0",
"np": "^5.0.1",
"prettier": "^1.17.1"
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-mocha": "^7.0.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"fastify": "^3.0.1",
"np": "^6.3.2",
"prettier": "^2.0.5"
}
}
Loading

0 comments on commit 8df77ba

Please sign in to comment.