Skip to content

Instantly share code, notes, and snippets.

@SidneyAllen
Last active October 29, 2021 18:20
Show Gist options
  • Save SidneyAllen/1e874ab83618cd0e57da1ecd5365353f to your computer and use it in GitHub Desktop.
Save SidneyAllen/1e874ab83618cd0e57da1ecd5365353f to your computer and use it in GitHub Desktop.
// templates/list.js
import fetch from "node-fetch";
export default async function listTemplate(req, res) {
const response = await fetch("https://api.lob.com/v1/templates", {
headers: {
Authorization: `Basic ${Buffer.from(
process.env.LOB_SECRET_API_KEY + ":"
).toString("base64")}`,
},
});
const templates = await response.json();
res.send(templates.data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment