notes/.vscode/extensions/paulzhang.fastify-snippets-0.0.5
2021-11-05 11:26:45 -07:00
..
images added vscode extensions 2021-11-05 11:26:45 -07:00
snippets added vscode extensions 2021-11-05 11:26:45 -07:00
.gitgnore added vscode extensions 2021-11-05 11:26:45 -07:00
.vsixmanifest added vscode extensions 2021-11-05 11:26:45 -07:00
demo.txt added vscode extensions 2021-11-05 11:26:45 -07:00
package.json added vscode extensions 2021-11-05 11:26:45 -07:00
README.md added vscode extensions 2021-11-05 11:26:45 -07:00

VS Code Fastify code snippets

Trigger Content
f.module→ Create fastify module
f.get→ a get router
f.post→ a post router
f.request.body→ the request body
f.request.query→ the parsed querystring
f.request.params→ the params matching the URL
f.request.headers→ the headers
f.request.raw→ the incoming HTTP request from Node core (you can use the alias req)
f.request.id→ the request id
f.reply.code→ the request id
f.reply.getHeader→ Retrieve value of already set header
f.reply.removeHeader→ Removed the value of a previously set header
f.reply.hasHeader→ Determine if a header has been set
f.reply.type→ Sets the header Content-Type
f.reply.redirect→ Redirect to the specified url, the status code is optional (default to 302)
f.reply.serialize→ Serializes the specified payload using the default json serializer and returns the serialized payload
f.reply.serializer→ Sets a custom serializer for the payload
f.reply.send→ Sends the payload to the user, could be a plain text, a buffer, JSON, stream, or an Error object
f.reply.sent→ A boolean value that you can use if you need to know if send has already been called
f.reply.res→ The http.ServerResponse from Node core