Skip to content

Commit

Permalink
Exacutable: npm run build to create executable for all platform!
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
daquinoaldo committed Apr 23, 2019
1 parent bf99505 commit 3dc0988
Show file tree
Hide file tree
Showing 5 changed files with 1,575 additions and 19 deletions.
7 changes: 3 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Pull Request Details

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

## Types of changes
<!-- Put an `x` in all the boxes that apply -->
Expand All @@ -19,8 +19,7 @@ Please, open a issue before a pull request. It will help in understanding better
<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have updated the documentation or my changes dont require it.
- [ ] I have read the [CONTRIBUTING](CONTRIBUTING.md) document.
- [ ] I have added tests to cover my changes (or the exist one were enough).
- [ ] I have added tests to cover my changes (or the existing one were enough).
- [ ] All new and existing tests passed.
11 changes: 3 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# MacOS
.DS_STORE

# IDEs
.idea
*.iml

# Node & npm
# Node, npm & CI
node_modules
coverage
.nyc_output

# Certificates
cert/localhost.*
cert/mkcert-*
# Build
build
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,22 @@ serve ~/myproj
```
- `sudo` may be necessary.
- If a static path is not provided the current directory content will be served.
- You can change the port setting the PORT environmental variable: `PORT=4433 serve ~/myproj`. Specifying port number will also prevent http to https redirect.
- You can change the **port** setting the `PORT` environmental variable: `PORT=4433 serve ~/myproj`. Specifying port number will also prevent http to https redirect.

### Binaries
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).
```
// Linux
./https-localhost-linux ~/myproj
// MacOS
./https-localhost-macos ~/myproj
// Windows
./https-localhost-win.exe C:\User\me\myproj
```
**Tip 1:** on Windows just drag the folder on the executable to serve itV.
**Tip 2:** on all platform put the executable on the folder you want to serve and double-click it.


## Use as module
Expand All @@ -37,9 +52,12 @@ const app = httpLocalhost()
// app is an express app, do what you usually do with express
app.listen(port)
```
- If the port number is not provided, it will listen on 443.
- To redirect the http traffic to https use `app.redirect()`.
- You can serve static files with `app.serve(path)`.
- If the **port** number is not provided, it will listen on 443.
- To **redirect** the http traffic to https use `app.redirect()`.
- You can serve **static files** with `app.serve(path)`.

**Tip:** consider installing it as a dev dependency: this is not a production tool!
`npm i --save-dev https-localhost`


## Production
Expand Down
Loading

0 comments on commit 3dc0988

Please sign in to comment.