Backbench Docs
  • Introduction
  • Getting Started
    • BBLANG
    • Node
    • Python
    • Go
  • Backbench Features and UI workflow
  • API Reference
    • BBLANG
    • Node
    • Python
    • Go
  • 3rd Party Integrations
    • Login using Facebook
    • Login using Google
    • Login with Twitter
    • Login using LinkedIn
    • Connection with MongoDB
    • Connection with MySQL
    • Geo Location Integration
    • Integration with AWS S3
    • Integration with Google Cloud Storage
    • Integration with Razorpay
    • Integration with Stripe
    • Integration with Mailchimp
    • Integration with Segment
    • Sending Emails with SendGrid
    • Sending Emails with Mailgun
    • Sending SMS with Twilio
    • Sending Push Notification with Pushwoosh
  • Troubleshooting and support
    • CNAME Support
    • FAQS
    • Error Codes
  • Testing
Powered by GitBook
On this page
  • How do I get headers or GET/POST params?
  • How do I redirect?
  • How do I set headers for response?
  1. Troubleshooting and support

FAQS

How do I get headers or GET/POST params?

exports.endpoint = function(req, cb){...}

You can get headers from req object as req.headers. Params can be get using req.query for GET and req.body for POST.

Try printing out req object, then you will have a clear Idea.

How do I redirect?

You can redirect from callback using the following format.

cb(undefined, {location: "https://google.com/"})

How do I set headers for response?

Right now, you can't because backbench is a Faas. But we are working on to integrate an API gateway too.

There is a provision for modifying headers, it can be done by putting headers property in second argument of callback inside an object. Now for the response to send you need to have a body object.

cb(undefined, {headers: {}, body: {"key": "hello world"}})

PreviousCNAME SupportNextError Codes

Last updated 6 years ago