Currently we are converting strings to JSON by default, but possibly we should render them as text-plain, without kicking in the serializer.
This is slightly related to https://github.com/fastify/fastify/issues/538, but a different use case.
I propose that:
fastify.get('/', (req, reply) => {
reply.send('hello world')
})
Renders hello world instead of "hello world".
Agree, I'll do this.
Why?
This can be achieved with
fastify.get('/', (req, reply) => {
reply.type('text/plain').send('hello world')
})
Because that's not what user will expect.
Most helpful comment
This is slightly related to https://github.com/fastify/fastify/issues/538, but a different use case.
I propose that:
Renders
hello worldinstead of"hello world".