You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,11 @@ It works with MacOS, Linux and Windows, on Chrome and Firefox, and requires you
16
16
## Dependencies
17
17
nss/certutils are needed for Firefox and Chrome.
18
18
#### MacOS
19
-
```
19
+
```bash
20
20
brew install nss
21
21
```
22
22
#### Linux
23
-
```
23
+
```bash
24
24
sudo apt install libnss3-tools
25
25
-or-
26
26
sudo yum install nss-tools
@@ -30,10 +30,10 @@ sudo pacman -S nss
30
30
31
31
32
32
## Install and use standalone
33
-
```
33
+
```bash
34
34
npm i -g --only=prod https-localhost
35
35
```
36
-
```
36
+
```bash
37
37
serve ~/myproj
38
38
```
39
39
-`sudo` may be necessary.
@@ -42,7 +42,7 @@ serve ~/myproj
42
42
43
43
### Binaries
44
44
If you don't have Node.js installed just use a packaged version! Download it from the [release page](https://github.com/daquinoaldo/https-localhost/releases).
45
-
```
45
+
```bash
46
46
# Linux
47
47
./https-localhost-linux ~/myproj
48
48
@@ -58,11 +58,11 @@ If you don't have Node.js installed just use a packaged version! Download it fro
58
58
59
59
## Use as module
60
60
Install as a dependency:
61
-
```
61
+
```bash
62
62
npm i -s https-localhost
63
63
```
64
64
Then put in your `index.js` file:
65
-
```
65
+
```javascript
66
66
consthttpsLocalhost=require("https-localhost")
67
67
constapp=httpsLocalhost()
68
68
// app is an express app, do what you usually do with express
@@ -78,7 +78,7 @@ app.listen(port)
78
78
79
79
## Production
80
80
This tool has a production version that activates **HTTP/2**, **compression** and **minify**.
81
-
```
81
+
```bash
82
82
NODE_ENV=production serve ~/myproj
83
83
```
84
84
I decide to not activate it by default since it is usually an unwanted behaviour for localhost testing, but sometimes it could be userful, e.g. to test Progressive Web Application or more ingeneral the website performances.
0 commit comments