Node JS Socket.IO
//—————- HTTPS Server —————————————- var fs = require(‚fs‘); var https = require(‚https‘); var express = require(‚express‘); var app = express(); var options = { key: fs.readFileSync(‚/etc/letsencrypt/live/hg-system.com/privkey.pem‘), cert: fs.readFileSync(‚/etc/letsencrypt/live/hg-system.com/fullchain.pem‘) }; var server = https.createServer(options, app); var port = 3000; server.listen(port, function() { log(‚listening on *:‘ + port); }); app.use(express.static(‚public‘)); app.get(‚/‘, (req, res) => { res.sendFile(‚index.html‘); }); weiterlesen…