-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
70 lines (67 loc) · 2.33 KB
/
app.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
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
// app.js
const express = require('express');
const path = require('path');
const app = express();
const port = 3000;
app.use(express.static(path.join(__dirname, 'public')));
app.get('/scripts/stellar_sdk_js', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'pages/eth_eip.html'));
});
app.get('/eth_standard', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'pages/eth_eip.html'));
});
app.get('/solana_standard', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'pages/solana_standard.html'));
});
app.get('/tron_standard', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'pages/tron_tip.html'));
});
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
});
app.get('/eth_wallet', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'pages/eth_wallet.html'));
});
app.get('/tron_wallet', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'pages/tron_wallet.html'));
});
app.get('/solana_wallet', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'pages/solana_wallet.html'));
});
app.get('/ton_wallet', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'pages/ton_wallet.html'));
});
app.get('/stellar_wallet', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'pages/stellar_wallet.html'));
});
app.get('/eth', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'eth.html'));
});
app.get('/solana', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'solana.html'));
});
app.get('/ton', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'ton.html'));
});
app.get('/tonconnect-manifest.json', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'ton-connect-manifest.json'));
});
app.listen(port, () => {
console.log(`Server listening at http://localhost:${port}`);
});
app.get('/webview', (req, res) => {
res.download(path.join(__dirname, 'public', 'webview.js'), 'webview.js', (err) => {
if (err) {
console.error('Error downloading file:', err);
res.status(500).send('Internal Server Error');
}
});
});
app.get('/tronweb', (req, res) => {
res.download(path.join(__dirname, 'public', 'tronweb.js'), 'tronweb.js', (err) => {
if (err) {
console.error('Error downloading file:', err);
res.status(500).send('Internal Server Error');
}
});
});