Last active
October 14, 2020 10:14
-
-
Save RealDyllon/0ca5498dbb0f1ac4af8ec93442f12a1d to your computer and use it in GitHub Desktop.
server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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