Skip to content

Instantly share code, notes, and snippets.

@RealDyllon
Last active October 14, 2020 10:14
Show Gist options
  • Save RealDyllon/0ca5498dbb0f1ac4af8ec93442f12a1d to your computer and use it in GitHub Desktop.
Save RealDyllon/0ca5498dbb0f1ac4af8ec93442f12a1d to your computer and use it in GitHub Desktop.
server.js
const express = require("express");
const app = express();
app.listen(3000, () => {
console.log("Server running on port 3000");
});
app.all("/", (req, res) => {
res.set({
"Content-Type": "application/json",
});
const itemUrl = req.query.item_url || (req.body && req.body.item_url); // itemUrl passed in GET query params / POST body
// send back to client
res.send({
details: {
/* parsed payload goes here */
},
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment