-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
38 lines (32 loc) · 1.06 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const express = require('express');
const fetch = require('node-fetch');
const { newSubscriber, shareReport, checkUlule, shareReportUlule } = require('./index');
const app = express();
const port = 3000;
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.post('/newSubscriber', newSubscriber);
app.get('/shareReport', shareReport);
app.get('/checkUlule', checkUlule);
app.get('/shareReportUlule', shareReportUlule)
app.listen(port, async () => {
console.log(`Example app listening at http://localhost:${port}`);
// fetch(`http://localhost:${port}/newSubscriber`, {
// headers: {
// 'Content-Type': 'application/json'
// },
// method: 'POST',
// body: JSON.stringify({
// id: '123456',
// email: '[email protected]',
// event: 'list_addition',
// key: 'xxxxxxxxxxxxxxxxxx',
// list_id: [7, 1],
// date: '2020-10-09 00:00:00',
// ts: 1604937111
// })
// });
// fetch(`http://localhost:${port}/shareReport`);
fetch(`http://localhost:${port}/checkUlule`);
// fetch(`http://localhost:${port}/shareReportUlule`);
});