Same code Project works mac but dosent work windows pc

I have a small SMS sending project, which works smoothly on Mac. I’ve set up an MSSQL server using Docker, allowing me to retrieve data, display it on the screen, group it, and send SMS messages upon pressing a button. However, I couldn’t get it to work on a Windows PC.

on Mac use these extension:

├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]

eror code on windows visual studio

[{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1109”,
“severity”: 8,
“message”: “Expression expected.”,
“source”: “ts”,
“startLineNumber”: 108,
“startColumn”: 18,
“endLineNumber”: 108,
“endColumn”: 20
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1109”,
“severity”: 8,
“message”: “Expression expected.”,
“source”: “ts”,
“startLineNumber”: 108,
“startColumn”: 26,
“endLineNumber”: 108,
“endColumn”: 27
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘irsaliyeNo’.”,
“source”: “ts”,
“startLineNumber”: 151,
“startColumn”: 17,
“endLineNumber”: 151,
“endColumn”: 27
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘cariAdi’.”,
“source”: “ts”,
“startLineNumber”: 151,
“startColumn”: 40,
“endLineNumber”: 151,
“endColumn”: 47
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘urunlerStr’.”,
“source”: “ts”,
“startLineNumber”: 151,
“startColumn”: 49,
“endLineNumber”: 151,
“endColumn”: 59
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘netTotal’.”,
“source”: “ts”,
“startLineNumber”: 151,
“startColumn”: 61,
“endLineNumber”: 151,
“endColumn”: 69
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 29,
“endLineNumber”: 152,
“endColumn”: 30
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘$’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 31,
“endLineNumber”: 152,
“endColumn”: 32
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 32,
“endLineNumber”: 152,
“endColumn”: 33
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘cariAdi’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 33,
“endLineNumber”: 152,
“endColumn”: 40
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 43,
“endLineNumber”: 152,
“endColumn”: 43
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 44,
“endLineNumber”: 152,
“endColumn”: 44
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘n’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 45,
“endLineNumber”: 152,
“endColumn”: 46
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 47,
“endLineNumber”: 152,
“endColumn”: 47
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 48,
“endLineNumber”: 152,
“endColumn”: 48
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘n’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 49,
“endLineNumber”: 152,
“endColumn”: 50
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 51,
“endLineNumber”: 152,
“endColumn”: 59
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 60,
“endLineNumber”: 152,
“endColumn”: 62
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “8010”,
“severity”: 8,
“message”: “Type annotations can only be used in TypeScript files.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 64,
“endLineNumber”: 152,
“endColumn”: 65
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 65,
“endLineNumber”: 152,
“endColumn”: 66
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘irsaliyeNo’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 66,
“endLineNumber”: 152,
“endColumn”: 76
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 79,
“endLineNumber”: 152,
“endColumn”: 79
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 80,
“endLineNumber”: 152,
“endColumn”: 80
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘n’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 81,
“endLineNumber”: 152,
“endColumn”: 82
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 83,
“endLineNumber”: 152,
“endColumn”: 83
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 84,
“endLineNumber”: 152,
“endColumn”: 84
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘n’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 85,
“endLineNumber”: 152,
“endColumn”: 86
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 87,
“endLineNumber”: 152,
“endColumn”: 94
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “8010”,
“severity”: 8,
“message”: “Type annotations can only be used in TypeScript files.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 95,
“endLineNumber”: 152,
“endColumn”: 95
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 96,
“endLineNumber”: 152,
“endColumn”: 96
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 97,
“endLineNumber”: 152,
“endColumn”: 97
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘n’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 98,
“endLineNumber”: 152,
“endColumn”: 99
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 100,
“endLineNumber”: 152,
“endColumn”: 100
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 101,
“endLineNumber”: 152,
“endColumn”: 101
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘n’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 102,
“endLineNumber”: 152,
“endColumn”: 103
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 104,
“endLineNumber”: 152,
“endColumn”: 105
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘$’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 104,
“endLineNumber”: 152,
“endColumn”: 105
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 105,
“endLineNumber”: 152,
“endColumn”: 106
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘urunlerStr’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 106,
“endLineNumber”: 152,
“endColumn”: 116
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 119,
“endLineNumber”: 152,
“endColumn”: 119
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 120,
“endLineNumber”: 152,
“endColumn”: 120
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘n’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 121,
“endLineNumber”: 152,
“endColumn”: 122
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 123,
“endLineNumber”: 152,
“endColumn”: 123
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 124,
“endLineNumber”: 152,
“endColumn”: 124
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘n’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 125,
“endLineNumber”: 152,
“endColumn”: 126
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 127,
“endLineNumber”: 152,
“endColumn”: 133
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “8010”,
“severity”: 8,
“message”: “Type annotations can only be used in TypeScript files.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 135,
“endLineNumber”: 152,
“endColumn”: 136
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 136,
“endLineNumber”: 152,
“endColumn”: 137
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘netTotal’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 137,
“endLineNumber”: 152,
“endColumn”: 145
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 146,
“endLineNumber”: 152,
“endColumn”: 148
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 149,
“endLineNumber”: 152,
“endColumn”: 149
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 150,
“endLineNumber”: 152,
“endColumn”: 150
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘n’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 151,
“endLineNumber”: 152,
“endColumn”: 152
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 153,
“endLineNumber”: 152,
“endColumn”: 153
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1127”,
“severity”: 8,
“message”: “Invalid character.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 154,
“endLineNumber”: 152,
“endColumn”: 154
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “2451”,
“severity”: 8,
“message”: “Cannot redeclare block-scoped variable ‘n’.”,
“source”: “ts”,
“startLineNumber”: 152,
“startColumn”: 155,
“endLineNumber”: 152,
“endColumn”: 156
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 185,
“startColumn”: 24,
“endLineNumber”: 185,
“endColumn”: 25
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 185,
“startColumn”: 25,
“endLineNumber”: 185,
“endColumn”: 26
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 185,
“startColumn”: 32,
“endLineNumber”: 185,
“endColumn”: 40
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1005”,
“severity”: 8,
“message”: “‘,’ expected.”,
“source”: “ts”,
“startLineNumber”: 185,
“startColumn”: 41,
“endLineNumber”: 185,
“endColumn”: 51
},{
“resource”: “/c:/Users/user/Desktop/project/apps.js”,
“owner”: “typescript”,
“code”: “1003”,
“severity”: 8,
“message”: “Identifier expected.”,
“source”: “ts”,
“startLineNumber”: 185,
“startColumn”: 52,
“endLineNumber”: 185,
“endColumn”: 53
}]

CODE ON MAC

const express = require(‘express’);
const app = express();
const port = 3085;
const sql = require(‘mssql’);
const bodyParser = require(‘body-parser’);
const axios = require(‘axios’);

app.use(bodyParser.json()); // JSON istek gövdelerini ayrıştırmak için

const config = {
user: ‘sa’,
password: ‘reallyStrongPwd123’,
server: ‘localhost’,
database: ‘LOGODB’,
options: {
encrypt: true, // Azure için gerekebilir, lokal için false olabilir
trustServerCertificate: true, // Sadece geliştirme/test ortamları için
}
};

const fetchData = async () => {
try {
await sql.connect(config);
const result = await sql.query( SELECT TOP 200 STF.FICHENO AS 'IRSALIYE_NO', STL.DATE_ AS 'IRSALIYE_TARIHI', CLC.CODE AS 'CARI_KODU', CLC.DEFINITION_ AS 'CARI_ADI', CLC.TELNRS1 AS 'TELEFON_NO', ITM.CODE AS 'MALZEME_KODU', STL.AMOUNT AS 'MIKTAR', CASE WHEN STL.VAT = 20 THEN ROUND(STL.PRICE * 1.2, 2) ELSE ROUND(STL.PRICE, 2) END AS 'BIRIM_FIYAT', STL.TOTAL AS 'TOPLAM', STL.VAT AS 'KDV', STF.NETTOTAL AS 'NETTOTAL', CLC.INCHARGE AS 'ILGILI' FROM LG_001_18_STLINE STL LEFT JOIN LG_001_ITEMS ITM ON ITM.LOGICALREF = STL.STOCKREF LEFT JOIN LG_001_18_STFICHE STF ON STF.LOGICALREF = STL.STFICHEREF LEFT JOIN LG_001_CLCARD CLC ON CLC.LOGICALREF = STL.CLIENTREF WHERE STL.TRCODE IN (7, 8, 1, 6) AND LINETYPE IN (0, 1) AND LINENET <> 0 ORDER BY STL.DATE_ DESC );
return result.recordset;
} catch (err) {
console.error(‘SQL error:’, err);
}
};

const processData = (data) => {
const groupedData = data.reduce((acc, curr) => {
const key = curr.IRSALIYE_NO;
if (!acc[key]) {
acc[key] = {
CARI_ADI: curr.ILGILI ? curr.ILGILI : curr.CARI_ADI,
IRSALIYE_NO: curr.IRSALIYE_NO,
Urunler: ,
NETTOTAL: curr.NETTOTAL,
TELEFON_NO: curr.TELEFON_NO || ‘11111111111’
};
}
acc[key].Urunler.push({
MALZEME_KODU: curr.MALZEME_KODU,
MIKTAR: curr.MIKTAR,
BIRIM_FIYAT: curr.BIRIM_FIYAT
});
return acc;
}, {});

let htmlTable = `
    <table border="1">
        <tr>
            <th>Cari Adı</th>
            <th>İrsaliye No</th>
            <th>Ürünler</th>
            <th>Nettotal</th>
            <th>telefon</th>
            <th>SMS Gönder</th> <!-- Yeni sütun eklendi -->
        </tr>
`;

Object.values(groupedData).forEach(item => {
    const urunlerStr = item.Urunler.map(urun => `${urun.MALZEME_KODU} \\n ${urun.MIKTAR} adet, \\n fiyat: ${urun.BIRIM_FIYAT} \\n `).join(" | ");
    htmlTable += `
        <tr>
            <td>${item.CARI_ADI}</td>
            <td>${item.IRSALIYE_NO}</td>
            <td>${urunlerStr}</td>
            <td>${item.NETTOTAL}</td>
            <td>${item.TELEFON_NO}</td>
            <td><button onclick="sendSMS('${item.IRSALIYE_NO}', '${item.TELEFON_NO}', '${item.CARI_ADI}', '${urunlerStr}', '${item.NETTOTAL}')">SMS Yolla</button></td> <!-- Buton eklendi -->
        </tr>
    `;
});

htmlTable += `</table>`;
htmlTable += `
    <script>
        function sendSMS(irsaliyeNo, telefonNo, cariAdi, urunlerStr, netTotal) {
            fetch('/sendSMS', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify({
                    irsaliyeNo: irsaliyeNo,
                    telefonNo: telefonNo,
                    cariAdi: cariAdi,
                    urunlerStr: urunlerStr,
                    netTotal: netTotal
                })
            })
            .then(response => response.text())
            .then(result => alert(result))
            .catch(error => console.error('SMS gönderme hatası:', error));
        }
    </script>
`;

return htmlTable;

};

// Ana yol için HTML görünümü
app.get(‘/’, async (req, res) => {
try {
const data = await fetchData
(); // Verileri çek
const htmlContent = processData(data); // Verileri işle
res.send(htmlContent); // HTML tablosunu gönder
} catch (error) {
console.error(‘Veri işleme hatası:’, error);
res.status(500).send(‘Veri işlenirken bir hata oluştu.’); // Hata mesajı gönder
}
});

// SMS gönderme işlemi için POST yöntemi
app.post(‘/sendSMS’, async (req, res) => {
try {
const { irsaliyeNo, telefonNo, cariAdi, urunlerStr, netTotal } = req.body; // İstek gövdesinden verileri al
const message = Cari: ${cariAdi}, \\n \\n İrsaliye No: ${irsaliyeNo}, \\n \\n Ürünler: \\n \\n ${urunlerStr}, \\n \\n Toplam: ${netTotal}TL \\n \\n; // Mesaj oluştur
const xmlData = <?xml version="1.0" encoding="UTF-8"?> <mainbody> <header> <company dil="XX">XXX</company> <usercode>XXXXXX</usercode> <password>XXXXX*</password> <type>1:n</type> <appkey>xxx</appkey> <msgheader>XX XX</msgheader> </header> <body> <msg>${message}</msg> <no>${telefonNo}</no> </body> </mainbody>; // XML içeriği oluştur
const url = ‘https://XXXXX/sms/send/xml’; // Hedef URL
// XML içeriğiyle birlikte HTTP POST isteği gönderme
const response = await axios.post(url, xmlData, {
headers: {
‘Content-Type’: ‘application/xml’, // İçerik türünü belirt
},
});
console.log(‘SMS gönderme başarılı:’, response.data);
res.send(‘SMS başarıyla gönderildi.’); // Başarılı yanıtı gönder
} catch (error) {
console.error(‘SMS gönderme hatası:’, error);
res.status(500).send(‘SMS gönderirken bir hata oluştu.’); // Hata mesajı gönder
}
});

// Sunucuyu başlatma
app.listen(port, () => {
console.log(Sunucu ${port} portunda başlatıldı.);
});

You set up mssql server on docker. Did you set the rest of the stuff up on docker? You can use docker-compose to set up multiple images for what you need to ensure smoothness between environments.

2 Likes

there is no docker app on windows pc. but on Mac I am using docker.

What do you mean there’s no docker on windows?

plus videos on installing on windows.

Using docker on windows can be very hard but you can also consider virtual machines or wsl. I use windows a lot and docker a lot, but not both together and try to avoid it.

That being said, if that’s not realistic for you. You need to be very precise about your project. You cannot copy paste one project from one computer to the other, rather, you copy over the essentials and then have some package manager build from a spec (like package.json).

1 Like