diff --git a/package.json b/package.json index eeaf140..9089a28 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "dev": "next dev", "build": "next build", "start": "next start", + "server": "node server.js", "lint": "next lint" }, "dependencies": { @@ -23,6 +24,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "hoyahax-2025": "file:", + "https-localhost": "^4.7.1", "lucide-react": "^0.474.0", "mongoose": "^8.9.5", "multer": "^1.4.5-lts.1", diff --git a/server.js b/server.js new file mode 100644 index 0000000..d632a19 --- /dev/null +++ b/server.js @@ -0,0 +1,17 @@ +const httpsLocalhost = require('https-localhost')() +const next = require('next') + +const dev = process.env.NODE_ENV !== 'production' +const app = next({ dev }) +const handle = app.getRequestHandler() + +app.prepare().then(() => { + httpsLocalhost.listen(3000, (err) => { + if (err) throw err + console.log('> Ready on https://localhost:3000') + }) + + httpsLocalhost.all('*', (req, res) => { + return handle(req, res) + }) +}) \ No newline at end of file