Skip to content

Commit 0055738

Browse files
committed
use https-localhost for local development
1 parent 0e6ea69 commit 0055738

3 files changed

Lines changed: 247 additions & 4 deletions

File tree

package-lock.json

Lines changed: 241 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"homepage": "https://github.com/mikesherov/course-secure-frontend#readme",
2525
"dependencies": {
2626
"express": "^4.17.1",
27-
"express-session": "^1.16.2"
27+
"express-session": "^1.16.2",
28+
"https-localhost": "^4.4.0"
2829
}
2930
}

site/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
const localHost = require("https-localhost");
12
const express = require("express");
23
const session = require("express-session");
34
const routeLogin = require("./routes/login");
45
const routeMessages = require("./routes/messages");
56

6-
const port = 80;
7+
const port = 443;
78
const domain = "localhost.charlesproxy.com";
89

9-
const app = express();
10+
const app = localHost(domain);
1011
app.use(express.urlencoded({ extended: true }));
1112

1213
app.use(
@@ -28,5 +29,5 @@ app.use("/static", express.static(__dirname + "/static"));
2829
app.listen(port);
2930

3031
console.log(
31-
`open http://${domain} to observe localhost network traffic via Charles`
32+
`open https://${domain} to observe localhost network traffic via Charles`
3233
);

0 commit comments

Comments
 (0)