fastify / fastify-mongodb

Fastify MongoDB connection plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fastify get route requires options?

vymao opened this issue · comments

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3.24.0

Plugin version

No response

Node.js version

16.13.0

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

12.0.1

Description

The Fastify get route may not have a properly overloaded get route, given that it seems we must specify options (which I thought were optional)?

Steps to Reproduce

In the README, there is this route:

fastify.get('/user/:id', function (req, reply) {
...
    })

However, sending a basic curl request gives this error:

victor@Victors-MBP Test3 % curl -X GET http://localhost:3000/user/:id
{"statusCode":500,"error":"Internal Server Error","message":"Argument \"options\" must not be function"}%
commented

Please provide a run-able example. At least it can start the server with node index.js.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.