2018-11-25 21:09:48 +01:00
|
|
|
const express = require("express");
|
2018-11-25 18:44:07 +01:00
|
|
|
const app = express();
|
|
|
|
app.use(express.json());
|
2018-11-25 21:09:48 +01:00
|
|
|
const convert = require("./util/convert");
|
2018-11-25 18:44:07 +01:00
|
|
|
|
2018-11-25 21:09:48 +01:00
|
|
|
app.get("/webhook/:provider", (req) => {
|
2018-11-25 18:44:07 +01:00
|
|
|
const strategy = req.params.provider;
|
|
|
|
const eventType = convert.getEvent[strategy](req.body);
|
|
|
|
});
|
2018-11-25 21:09:48 +01:00
|
|
|
app.listen(2000, () => console.log("Listening on port 2000"));
|