mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-11-13 23:19:21 +01:00
Compare commits
2 Commits
2e343cbd0c
...
f5259f7ade
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5259f7ade | ||
|
|
1fcf7cd988 |
@@ -2,7 +2,7 @@
|
|||||||
"name": "freedom-loader",
|
"name": "freedom-loader",
|
||||||
"desktopName": "com.masteracnolo.freedomloader",
|
"desktopName": "com.masteracnolo.freedomloader",
|
||||||
"productName": "Freedom Loader",
|
"productName": "Freedom Loader",
|
||||||
"version": "1.6.4",
|
"version": "1.6.5",
|
||||||
"author": "MasterAcnolo <MasterAcnolo@users.noreply.github.com>",
|
"author": "MasterAcnolo <MasterAcnolo@users.noreply.github.com>",
|
||||||
"description": "Free and open-source GUI for yt-dlp — download video and audio from hundreds of platforms",
|
"description": "Free and open-source GUI for yt-dlp — download video and audio from hundreds of platforms",
|
||||||
"homepage": "https://freedomloader.acnolo.fr/",
|
"homepage": "https://freedomloader.acnolo.fr/",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ app.get("/", rateLimit, (req, res) => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes and starts the Express HTTP server.
|
* Initializes and starts the Express HTTP server.
|
||||||
*
|
*
|
||||||
* - Binds the server to `config.applicationPort`
|
* - Binds the server to `config.applicationPort`
|
||||||
* - Resolves with the HTTP server instance on successful startup
|
* - Resolves with the HTTP server instance on successful startup
|
||||||
* - Rejects on server binding or runtime errors
|
* - Rejects on server binding or runtime errors
|
||||||
@@ -36,7 +36,7 @@ app.get("/", rateLimit, (req, res) => {
|
|||||||
*/
|
*/
|
||||||
async function startServer() {
|
async function startServer() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const serverInstance = app.listen(config.applicationPort, () => {
|
serverInstance = app.listen(config.applicationPort, () => {
|
||||||
logger.info(`Express server ready at http://localhost:${config.applicationPort}`);
|
logger.info(`Express server ready at http://localhost:${config.applicationPort}`);
|
||||||
resolve(serverInstance);
|
resolve(serverInstance);
|
||||||
});
|
});
|
||||||
@@ -53,11 +53,13 @@ async function startServer() {
|
|||||||
*/
|
*/
|
||||||
function stopServer() {
|
function stopServer() {
|
||||||
if (serverInstance) {
|
if (serverInstance) {
|
||||||
try{
|
try {
|
||||||
serverInstance.close();
|
serverInstance.close(() => {
|
||||||
logger.info("Express server closed cleanly");
|
logger.info("Express server closed cleanly");
|
||||||
} catch (err){
|
});
|
||||||
logger.error("Express server was not closed cleanly:", err)
|
serverInstance = null;
|
||||||
|
} catch (err) {
|
||||||
|
logger.error("Express server was not closed cleanly:", err);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info("Express server was already closed");
|
logger.info("Express server was already closed");
|
||||||
|
|||||||
Reference in New Issue
Block a user