我读了https://github.com/fastify/fastify/blob/master/docs/Routes.md
但是我的路由器似乎无法通过参数捕获正确的网址
网址:/app/name?id=666&method=3&_=1553342444710
我尝试过:
fastify.get('/app/:id-:method:*', (request, reply) => {
fastify.get('/app/*', (request, reply) => {
fastify.get('/app/:id-:method:-:_', (request, reply) => {
答案 0 :(得分:1)
尝试一下:
fastify.get('/app/name', {
schema: {
querystring: {
id: { type: 'integer' },
name: { type: 'string' },
_: { type: 'integer' },
}
},
},
(request, reply) => {
...