-
-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Description
🐛 Bug Report
when I register api module and give it a prefix option and then in the module file I can't set get route without any additional path name fastify.get('/', { websocket: true }, <function>)
and it gives me the error
AssertionError [ERR_ASSERTION]: Method 'GET' already declared for route '/api/'
it works when I add something to get path like fastify.get('/hi', { websocket: true }, <function>)
app.js
fastify.register(require('fastify-websocket'))
fastify.register(require('./api), { prefix: '/api' }api.js
fastify.get('/', { websocket: true }, <function>)Expected behavior
It should work in websocket. like it works fine without websocket (regular get '/' path)
Your Environment
- node version: 12
- fastify version: >=2.0.0
- os: Windows
Metadata
Metadata
Assignees
Labels
No labels