diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2024-10-21 14:54:11 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2024-10-21 14:54:11 +0700 |
| commit | 83d1a1c558293e1b14c9a5847628e7661f749c66 (patch) | |
| tree | 5f083f90192df0fc2aff41e3dd1c3c84f2592352 /server.js | |
| parent | 30c5eb5776fcc60f023ad6aa51153cb375c87930 (diff) | |
initial commit
Diffstat (limited to 'server.js')
| -rw-r--r-- | server.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/server.js b/server.js new file mode 100644 index 0000000..240435e --- /dev/null +++ b/server.js @@ -0,0 +1,19 @@ +const next = require('next'); +const https = require('https'); +const fs = require('fs'); + +const dev = process.env.NODE_ENV !== 'production'; +const app = next({ dev }); +const handle = app.getRequestHandler(); + +app.prepare().then(() => { + https.createServer({ + key: fs.readFileSync('./localhost-key.pem'), + cert: fs.readFileSync('./localhost.pem'), + }, (req, res) => { + handle(req, res); + }).listen(3000, (err) => { + if (err) throw err; + console.log('> Ready on https://localhost:3000'); + }); +}); |
