diff --git a/app/package.json b/app/package.json index fa33ee8..4fbe119 100644 --- a/app/package.json +++ b/app/package.json @@ -4,7 +4,6 @@ "private": true, "scripts": { "dev": "next dev", - "https": "node server.js", "build": "next build", "start": "next start", "lint": "next lint" diff --git a/app/server.js b/app/server.js deleted file mode 100644 index 38c8842..0000000 --- a/app/server.js +++ /dev/null @@ -1,34 +0,0 @@ -const https = require('https'); -const httpProxy = require('http-proxy'); -const ws = require('ws'); -const fs = require('fs'); -const port = 3001 - -console.log('running') - -const options = { - key: fs.readFileSync('localhost-key.pem'), - cert: fs.readFileSync('localhost.pem') -}; - -const proxy = httpProxy.createProxyServer({ - target: 'http://0.0.0.0:3000' -}); - -const server = https.createServer(options, (req, res) => { - proxy.web(req, res); -}); - -const wssProxy = new ws.Server({ noServer: true }); -server.on('upgrade', (req, socket, head) => { - console.log(req.url) - if (req.url.startsWith('/_next/webpack-hmr')) { - wssProxy.handleUpgrade(req, socket, head, (ws) => { - proxy.ws(req, ws, head); - }); - } else { - socket.destroy(); - } -}); - -server.listen(port) \ No newline at end of file diff --git a/ecosystem.config.js b/ecosystem.config.js index 352874a..595e872 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -5,11 +5,6 @@ module.exports = { name: "thingtime-app", namespace: "thingtime" }, - { - script: 'npm run app-https', - name: "thingtime-app-https", - namespace: "thingtime" - }, { script: 'npm run api', name: 'thingtime-api',