Skip to content

Commit e5c32e1

Browse files
committed
Rename binary from serve to https-localhost
- Fixes daquinoaldo#57
1 parent 4031e95 commit e5c32e1

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ sudo pacman -S nss
3838
npm i -g --only=prod https-localhost
3939
```
4040
```bash
41-
serve ~/myproj
41+
https-localhost ~/myproj
4242
```
4343
- `sudo` may be necessary.
4444
- If a static path is not provided the current directory content will be served.
45-
- You can change the **port** setting the `PORT` environmental variable: `PORT=4433 serve ~/myproj`. Specifying port number will also prevent http to https redirect.
45+
- You can change the **port** setting the `PORT` environmental variable: `PORT=4433 https-localhost ~/myproj`. Specifying port number will also prevent http to https redirect.
4646

4747
### Binaries
4848
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).
@@ -91,7 +91,7 @@ const server = https.createServer(certs, app).listen(port)
9191
## Production
9292
This tool has a production version that activates **HTTP/2**, **compression** and **minify**.
9393
```bash
94-
NODE_ENV=production serve ~/myproj
94+
NODE_ENV=production https-localhost ~/myproj
9595
```
9696
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.
9797

@@ -129,14 +129,14 @@ https-localhost is compatible with the LTS and latest version of Node.js.
129129
<sub>If you need compatibility with other Node.js versions let me know, we'll try to rearrange the code.</sub>
130130

131131
### root required
132-
- **At first run** this tool generate a trusted certificate. The sudo password may be required. If you cannot provide the sudo password generate a `localhost.key` and `localhost.crt` and specify its path with `CERT_PATH=/diractory/containing/certificates/ serve ~/myproj`.
132+
- **At first run** this tool generate a trusted certificate. The sudo password may be required. If you cannot provide the sudo password generate a `localhost.key` and `localhost.crt` and specify its path with `CERT_PATH=/diractory/containing/certificates/ https-localhost ~/myproj`.
133133
- **At each run** the password may be required to run the server on port 443 and 80. To avoid the script ask for password specify a different port number: `PORT=4433 serve ~/myproj`.
134134

135135
### EACCES
136-
Run with sudo to use the default ports 443 and 80. You can also change port with: `PORT=4433 serve ~/myproj`.
136+
Run with sudo to use the default ports 443 and 80. You can also change port with: `PORT=4433 https-localhost ~/myproj`.
137137

138138
### EADDRINUSE
139-
Another service on your machine is using port 443 or port 80. Stop it or change port with `PORT=4433 serve ~/myproj`.
139+
Another service on your machine is using port 443 or port 80. Stop it or change port with `PORT=4433 https-localhost ~/myproj`.
140140

141141
### Unable to run on Windows
142142
Windows users with spaces or quotes in the name (like Aldo D'Aquino) may experience some problems in running the script. You can try to escape this chars or put the entire path between double quotes, but I suggest you to switch to a better user name (like aldodaquino).
@@ -154,7 +154,7 @@ I've tried to reproduce this error without any success (checkout the [Travis bui
154154
### ERR_SSL_PROTOCOL_ERROR
155155
And in general all the cases when the script runs but the connection is marked as untrusted.
156156

157-
Force a reinstall of the certificate with `REINSTALL=true serve`. `sudo` may be required on linux and MacOS.
157+
Force a reinstall of the certificate with `REINSTALL=true https-localhost`. `sudo` may be required on linux and MacOS.
158158

159159
If the problem is solved you should be able to use https-localhost also as module.
160160

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"start": "node index.js"
1212
},
1313
"bin": {
14-
"serve": "index.js"
14+
"https-localhost": "index.js"
1515
},
1616
"pkg": {
1717
"scripts": "*.js",

0 commit comments

Comments
 (0)