Skip to content

Commit 3dc0988

Browse files
committed
Exacutable: npm run build to create executable for all platform!
Add pkg to package all this code into an executable that doesn't require a node.js installation. This allow to easly distribute this tool.
1 parent bf99505 commit 3dc0988

File tree

5 files changed

+1575
-19
lines changed

5 files changed

+1575
-19
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Pull Request Details
77

88
## Related Issue
9-
Please, open a issue before a pull request. It will help in understanding better the PR aim.
9+
Please, open an issue before a pull request. It will help in understanding better the PR aim.
1010

1111
## Types of changes
1212
<!-- Put an `x` in all the boxes that apply -->
@@ -19,8 +19,7 @@ Please, open a issue before a pull request. It will help in understanding better
1919
<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
2020
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
2121
- [ ] My code follows the code style of this project.
22-
- [ ] My change requires a change to the documentation.
23-
- [ ] I have updated the documentation accordingly.
22+
- [ ] I have updated the documentation or my changes dont require it.
2423
- [ ] I have read the [CONTRIBUTING](CONTRIBUTING.md) document.
25-
- [ ] I have added tests to cover my changes (or the exist one were enough).
24+
- [ ] I have added tests to cover my changes (or the existing one were enough).
2625
- [ ] All new and existing tests passed.

.gitignore

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
# MacOS
22
.DS_STORE
33

4-
# IDEs
5-
.idea
6-
*.iml
7-
8-
# Node & npm
4+
# Node, npm & CI
95
node_modules
106
coverage
117
.nyc_output
128

13-
# Certificates
14-
cert/localhost.*
15-
cert/mkcert-*
9+
# Build
10+
build

README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,22 @@ serve ~/myproj
2222
```
2323
- `sudo` may be necessary.
2424
- If a static path is not provided the current directory content will be served.
25-
- You can change the port setting the PORT environmental variable: `PORT=4433 serve ~/myproj`. Specifying port number will also prevent http to https redirect.
25+
- You can change the **port** setting the `PORT` environmental variable: `PORT=4433 serve ~/myproj`. Specifying port number will also prevent http to https redirect.
26+
27+
### Binaries
28+
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).
29+
```
30+
// Linux
31+
./https-localhost-linux ~/myproj
32+
33+
// MacOS
34+
./https-localhost-macos ~/myproj
35+
36+
// Windows
37+
./https-localhost-win.exe C:\User\me\myproj
38+
```
39+
**Tip 1:** on Windows just drag the folder on the executable to serve itV.
40+
**Tip 2:** on all platform put the executable on the folder you want to serve and double-click it.
2641

2742

2843
## Use as module
@@ -37,9 +52,12 @@ const app = httpLocalhost()
3752
// app is an express app, do what you usually do with express
3853
app.listen(port)
3954
```
40-
- If the port number is not provided, it will listen on 443.
41-
- To redirect the http traffic to https use `app.redirect()`.
42-
- You can serve static files with `app.serve(path)`.
55+
- If the **port** number is not provided, it will listen on 443.
56+
- To **redirect** the http traffic to https use `app.redirect()`.
57+
- You can serve **static files** with `app.serve(path)`.
58+
59+
**Tip:** consider installing it as a dev dependency: this is not a production tool!
60+
`npm i --save-dev https-localhost`
4361

4462

4563
## Production

0 commit comments

Comments
 (0)