From 08e20ba0d465fe1da114bd2afe9b737dc499c902 Mon Sep 17 00:00:00 2001 From: The-XENO-Studios Date: Tue, 2 Apr 2024 00:44:16 +0600 Subject: [PATCH] Delete server.js --- server.js | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 server.js diff --git a/server.js b/server.js deleted file mode 100644 index 37dd5cf..0000000 --- a/server.js +++ /dev/null @@ -1,23 +0,0 @@ -const next = require('next'); -const express = require('express'); - -const DEV = process.env.NODE_ENV !== 'production'; -const PORT = process.env.PORT || 3000; - -const app = express(); -const nextApp = next({ dev: DEV }); -const handle = nextApp.getRequestHandler(); - -app.enable('trust proxy'); -app.use((request, response, next) => { - if (process.env.NODE_ENV != 'development' && !request.secure) { - return response.redirect(`https://${request.headers.host}${request.url}`); - } - next(); -}); -nextApp.prepare().then(() => { - app.get('*', (req, res) => handle(req, res)); - app.listen(PORT, () => { - console.info('Server running at port: ' + PORT); - }); -});