Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "use strict"
- module.exports = function (fastify, opts, next) {
- fastify.get("/", (req, res) => {
- return res.sendFile("index.html")
- })
- fastify.post("/receivedPOST", (req, res) => {
- return res.code(307).redirect("/redirectPOST") // Status code is always 302, even though it's set to 307
- })
- fastify.post("/redirectPOST", (req, res) => {
- console.log(req.body) // Should give back POST data
- })
- next()
- }
Add Comment
Please, Sign In to add comment