Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seleb/pkg-and-serve
boilerplate for packaging a static server with an app in an exe
https://github.com/seleb/pkg-and-serve
boilerplate executable express pkg
Last synced: about 2 months ago
JSON representation
boilerplate for packaging a static server with an app in an exe
- Host: GitHub
- URL: https://github.com/seleb/pkg-and-serve
- Owner: seleb
- License: mit
- Created: 2019-07-14T17:34:10.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-11T22:38:43.000Z (4 months ago)
- Last Synced: 2024-09-12T08:50:13.358Z (4 months ago)
- Topics: boilerplate, executable, express, pkg
- Language: JavaScript
- Homepage:
- Size: 703 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# `pkg-and-serve`
This project allows you to package a static website as a single executable file. This executable will start a local server hosting your site, open it in the user's default browser, and shut itself down when the site is closed.
Note that this is most useful for quickly creating a shareable file for testing/portable deployment, and will usually be a less ideal user experience when compared with a full desktop application (e.g. with [Electron](https://www.electronjs.org/)).
## Usage
### As command-line tool
```sh
npx pkg-and-serve [input] [output]
```### As boilerplate project
1. clone
2. `npm i`
3. replace contents of `./app` with your app
4. update `name` in `pkg.config.json`
5. add additional localhost endpoints in `server.js` if needed
6. `npm run build`
7. self-contained build outputs will be in `./build`