summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Marçalo <raroma09@gmail.com>2022-10-23 15:30:31 +0100
committerRafael Marçalo <raroma09@gmail.com>2022-10-23 15:30:31 +0100
commit99083647f64123e3cfd816788dc5531641f43010 (patch)
tree2296096cada45af29bd64ca6883066415fe80a6c
parent2d85011451abb47bd0debc199e0faf5e0abd58f0 (diff)
Electron forge support for package compression
-rw-r--r--app.js2
-rw-r--r--launch-electron.js (renamed from launch.js)2
-rw-r--r--package.json35
3 files changed, 33 insertions, 6 deletions
diff --git a/app.js b/app.js
index 04ea216..da2a3b7 100644
--- a/app.js
+++ b/app.js
@@ -27,4 +27,4 @@ app.get('/visit', visit);
app.post('/search', search);
// app start
-app.listen(PORT); \ No newline at end of file
+app.listen(PORT, () => console.log("Server running on port " + PORT));
diff --git a/launch.js b/launch-electron.js
index 92c4247..598ce1c 100644
--- a/launch.js
+++ b/launch-electron.js
@@ -3,6 +3,8 @@
const { app, BrowserWindow } = require('electron');
const server = require('./app');
+if (require('electron-squirrel-startup')) return app.quit();
+
function createWindow()
{
const win = new BrowserWindow({
diff --git a/package.json b/package.json
index 6b2b613..3ccfac3 100644
--- a/package.json
+++ b/package.json
@@ -2,10 +2,12 @@
"name": "sneedbay",
"version": "1.0.0",
"description": "Piratebay indexing tool",
- "main": "launch.js",
+ "main": "launch-electron.js",
"scripts": {
- "start": "electron launch.js",
- "dev": "node app.js"
+ "start": "electron-forge start",
+ "server": "node app.js",
+ "package": "electron-forge package",
+ "make": "electron-forge make"
},
"keywords": [
"piratebay",
@@ -19,9 +21,32 @@
"license": "GPL-3.0-or-later",
"dependencies": {
"ejs": "^3.1.8",
+ "electron": "^21.2.0",
+ "electron-squirrel-startup": "^1.0.0",
"express": "^4.18.2"
},
"devDependencies": {
- "electron": "^21.2.0"
+ "electron": "^21.2.0",
+ "@electron-forge/cli": "^6.0.0-beta.67",
+ "@electron-forge/maker-squirrel": "^6.0.0-beta.67",
+ "@electron-forge/maker-zip": "^6.0.0-beta.67"
+ },
+ "config": {
+ "forge": {
+ "packagerConfig": {
+ "asar": true,
+ "icon": "public/static/images/favicon.ico"
+ },
+ "makers": [{
+ "name": "@electron-forge/maker-squirrel",
+ "config": {
+ "name": "sneedbay"
+ }
+ },
+ {
+ "name": "@electron-forge/maker-zip"
+ }
+ ]
+ }
}
-} \ No newline at end of file
+}