Skip to content

Commit 6218153

Browse files
committed
docs
1 parent 41bd454 commit 6218153

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
> Web server + ElectronJS to wrap any website into the native window
44
5+
![screencast](./assets/screencast.gif)
6+
57
## Usage
68

79
**1. Install dependencies**
@@ -30,3 +32,8 @@ npm run build:windows
3032
```bash
3133
npm run build:linux
3234
```
35+
36+
**4. Run**
37+
38+
Double click on `*.msi` to install the app. The right click is disabled and menu bar is hidden. The static assets are shared on `http://localhost:1338`.
39+

assets/screencast.gif

1.03 MB
Loading

src/main.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ const http = require('http');
77
const APP_PORT = 1338;
88

99
app.commandLine.appendSwitch('js-flags', '--max-old-space-size=16384');
10+
app.commandLine.appendSwitch("disable-http-cache");
1011

1112
const uri = path.join(path.dirname(app.getPath('exe')), 'resources');
1213

1314
const server = http.createServer((request, response) => {
1415
return handler(request, response, {
1516
public: uri,
17+
headers: {
18+
'Cache-Control': 'no-store, no-cache, must-revalidate, max-age=0'
19+
},
1620
});
1721
});
1822

@@ -56,7 +60,9 @@ async function createWindow () {
5660
mainWindow.setMenuBarVisibility(false);
5761
mainWindow.setMenu(null);
5862

59-
mainWindow.loadURL(`http://localhost:${APP_PORT}`);
63+
mainWindow.loadURL(`http://localhost:${APP_PORT}`, {
64+
extraHeaders: "pragma: no-cache\n"
65+
});
6066
}
6167

6268
app.whenReady().then(() => {

0 commit comments

Comments
 (0)