Skip to content

Instantly share code, notes, and snippets.

@marckohlbrugge
Created Jul 11, 2021
Embed
What would you like to do?
const { getAverageColor } = require('fast-average-color-node');
const express = require("express");
const app = express();
const port = process.env.PORT || 3001;
app.get("/", (req, res) => res.send("Hello there!"));
app.get("/colors", (req, res) => {
getAverageColor(req.query.url).then(color => {
res.send(color);
});
});
app.listen(port, () => console.log(`Example app listening on port ${port}!`));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment