Sending Outgoing HTTP responses

Interacting with outgoing HTTP responses from a Napkin function follows the same pattern as that of [requests]. For Python, response data is set via the built-in napkin.response Python module. For Node.js, you must export a default function that takes two parameters, req (request) and res (response). This was intentionally designed to mimic the Express API, which most Node.js developers are already familiar with.


from napkin import response


export default (req, res) => {
    // ...