Skip to content

Commit

Permalink
Prefix is now coming directly from fastify instead of using symbols (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tirke authored May 6, 2022
1 parent 4b2ee07 commit cfa7244
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

const fp = require('fastify-plugin')
const symbols = require('fastify/lib/symbols')
const Middie = require('./engine')
const kMiddlewares = Symbol('fastify-middie-middlewares')
const kMiddie = Symbol('fastify-middie-instance')
Expand All @@ -17,7 +16,7 @@ function middiePlugin (fastify, options, next) {

function use (path, fn) {
if (typeof path === 'string') {
const prefix = this[symbols.kRoutePrefix]
const prefix = this.prefix
path = prefix + (path === '/' && prefix.length > 0 ? '' : path)
}
this[kMiddlewares].push([path, fn])
Expand Down

0 comments on commit cfa7244

Please sign in to comment.