outfit-images: add api endpoint
Just returns the placeholder image right now!
This commit is contained in:
parent
d875b5f6ce
commit
d10fe5f68f
1 changed files with 19 additions and 0 deletions
19
api/outfitImage.js
Normal file
19
api/outfitImage.js
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
const beeline = require("honeycomb-beeline")({
|
||||||
|
writeKey: process.env["HONEYCOMB_WRITE_KEY"],
|
||||||
|
dataset:
|
||||||
|
process.env["NODE_ENV"] === "production"
|
||||||
|
? "Dress to Impress (2020)"
|
||||||
|
: "Dress to Impress (2020, dev)",
|
||||||
|
serviceName: "impress-2020-gql-server",
|
||||||
|
});
|
||||||
|
|
||||||
|
const { renderOutfitImage } = require("../src/server/outfit-images");
|
||||||
|
|
||||||
|
async function handle(req, res) {
|
||||||
|
const image = await renderOutfitImage();
|
||||||
|
return res.status(200).setHeader("Content-Type", "image/png").send(image);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async (req, res) => {
|
||||||
|
beeline.withTrace({ name: "outfitImage" }, () => handle(req, res));
|
||||||
|
};
|
Loading…
Reference in a new issue