-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.ts
109 lines (88 loc) · 2.94 KB
/
server.ts
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import * as express from 'express';
import { Request, Response } from 'express';
import {SendText} from './example/sender_of_requests/sendText';
import {SendPhoto} from './example/sender_of_requests/sendPhoto';
import {SendFile} from './example/sender_of_requests/sendFile';
import {SendLocation} from './example/sender_of_requests/sendLocation';
import {GetUserInfo} from './example/sender_of_requests/getUserInfo';
import {RequestCustom} from './example/sender_of_requests/custom';
const app = express();
const port = 3000;
//////////////
// sendText //
//////////////
app.get('/sendText.telegram', async (req: Request, res: Response) => {
res.send(await SendText.telegram());
});
app.get('/sendText.vk', async (req: Request, res: Response) => {
res.send(await SendText.vk());
});
app.get('/sendText.viber', async (req: Request, res: Response) => {
res.send(await SendText.viber());
});
///////////////
// sendPhoto //
///////////////
app.get('/sendPhoto.telegram', async (req: Request, res: Response) => {
res.send(await SendPhoto.telegram());
});
app.get('/sendPhoto.vk', async (req: Request, res: Response) => {
res.send(await SendPhoto.vk());
});
app.get('/sendPhoto.viber', async (req: Request, res: Response) => {
res.send(await SendPhoto.viber());
});
//////////////
// sendFile //
//////////////
app.get('/sendFile.telegram', async (req: Request, res: Response) => {
res.send(await SendFile.telegram());
});
app.get('/sendFile.vk', async (req: Request, res: Response) => {
res.send(await SendFile.vk());
});
app.get('/sendFile.viber', async (req: Request, res: Response) => {
res.send(await SendFile.viber());
});
//////////////////
// sendLocation //
//////////////////
app.get('/sendLocation.telegram', async (req: Request, res: Response) => {
res.send(await SendLocation.telegram());
});
app.get('/sendLocation.vk', async (req: Request, res: Response) => {
res.send(await SendLocation.vk());
});
app.get('/sendLocation.viber', async (req: Request, res: Response) => {
res.send(await SendLocation.viber());
});
/////////////////
// getUserInfo //
/////////////////
app.get('/getUserInfo.telegram', async (req: Request, res: Response) => {
res.send(await GetUserInfo.telegram());
});
app.get('/getUserInfo.vk', async (req: Request, res: Response) => {
res.send(await GetUserInfo.vk());
});
app.get('/getUserInfo.viber', async (req: Request, res: Response) => {
res.send(await GetUserInfo.viber());
});
///////////////////
// requestCustom //
///////////////////
app.get('/requestCustom.telegram', async (req: Request, res: Response) => {
res.send(await RequestCustom.telegram());
});
app.get('/requestCustom.vk', async (req: Request, res: Response) => {
res.send(await RequestCustom.vk());
});
app.get('/requestCustom.viber', async (req: Request, res: Response) => {
res.send(await RequestCustom.viber());
});
////////////
// listen //
////////////
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
});