Guest User

Untitled

a guest
Jul 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. "use strict"
  2.  
  3. module.exports = function (fastify, opts, next) {
  4. fastify.get("/", (req, res) => {
  5. return res.sendFile("index.html")
  6. })
  7. fastify.post("/receivedPOST", (req, res) => {
  8. return res.code(307).redirect("/redirectPOST") // Status code is always 302, even though it's set to 307
  9. })
  10. fastify.post("/redirectPOST", (req, res) => {
  11. console.log(req.body) // Should give back POST data
  12. })
  13. next()
  14. }
Add Comment
Please, Sign In to add comment