Skip to content

Commit

Permalink
added dotenv support to ssl pems
Browse files Browse the repository at this point in the history
  • Loading branch information
Tzesh committed Jun 25, 2023
1 parent 1bfb65b commit 27fdf22
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"@notionhq/client": "^0.2.2",
"dotenv": "^16.3.1",
"next": "^12.0.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
9 changes: 4 additions & 5 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
const next = require('next');

const https = require('https');

const dotenv = require('dotenv');
const fs = require("fs");

// configure environment variables
dotenv.config();
const hostname = 'localhost'
const port = 443
const dev = process.env.NODE_ENV !== 'production'

const app = next({ dev, hostname, port });

const sslLocation = process.env.SSL_LOCATION;

const sslOptions = {
Expand All @@ -18,7 +17,7 @@ const sslOptions = {
ca: fs.readFileSync(sslLocation + "chain.pem")
};

const handle = app.getRequestHandler()
const handle = app.getRequestHandler();

app.prepare().then(() => {
const server = https.createServer(sslOptions, (req, res) => {
Expand Down

0 comments on commit 27fdf22

Please sign in to comment.