From b76998c33483adbb58e198ed223544ee594f5630 Mon Sep 17 00:00:00 2001 From: Patrick <patrick.wuerstle@gmx.de> Date: Fri, 11 Sep 2020 11:48:46 +0200 Subject: [PATCH] test --- server.js | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/server.js b/server.js index d6aedaf06..a7e47077e 100644 --- a/server.js +++ b/server.js @@ -1,31 +1,58 @@ - -const fs = require('fs'); const http = require('http'); -const https = require('https'); -const express = require('express'); - +const http = require('https'); +const fs = require('fs'); +const express = require('express') const app = express(); +const bodyParser = require('body-parser') +// app.use(bodyParser.urlencoded({ extended: false })) +// app.use(bodyParser.json()) +const request = require('ajax-request'); + +// app.use(express.static('vcm')); +// app.listen(process.env.PORT || 8083); + +// const app = express(); // Certificate const privateKey = fs.readFileSync('/etc/letsencrypt/live/umfrage.smartvillages.online/privkey.pem', 'utf8'); const certificate = fs.readFileSync('/etc/letsencrypt/live/umfrage.smartvillages.online/cert.pem', 'utf8'); const ca = fs.readFileSync('/etc/letsencrypt/live/umfrage.smartvillages.online/chain.pem', 'utf8'); + const credentials = { key: privateKey, cert: certificate, ca: ca }; -app.use(express.static(__dirname)); +app.use(express.static(__dirname, { dotfiles: 'allow' } )); // Starting both http & https servers const httpServer = http.createServer(app); const httpsServer = https.createServer(credentials, app); -httpServer.listen(8083, () => { - console.log('HTTP Server running on port 80'); +httpServer.listen(8084, () => { + console.log('HTTP Server running on port 80'); +}); + +httpsServer.listen(8083, () => { + console.log('HTTPS Server running on port 8083'); }); -httpsServer.listen(8084, () => { - console.log('HTTPS Server running on port 443'); -}); \ No newline at end of file +// app.post('/addpoint', function(req,res){ + +// try { + +// const data = req.body; +// console.log("data ==============") +// console.log(data.id); +// args.gmlid = data.id +// console.log(data[0]); +// console.log(data[1]); +// console.log("args ==============") +// console.log(args); + +// } +// catch (err) { +// console.log('.../getSimS failed!\n' + err); +// } +// }); \ No newline at end of file -- GitLab