[PR #3808] [MERGED] Merge prod.js into index.js #4092

Closed
opened 2026-04-25 00:18:17 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3808
Author: @mikiher
Created: 1/7/2025
Status: Merged
Merged: 1/8/2025
Merged by: @advplyr

Base: masterHead: merge-prod-js-index-js


📝 Commits (2)

📊 Changes

4 files changed (+36 additions, -11 deletions)

View changed files

📝 Dockerfile (+5 -0)
📝 index.js (+26 -6)
📝 package-lock.json (+1 -1)
📝 package.json (+4 -4)

📄 Description

Brief summary

Merges prod.js and index.js.

Which issue is fixed?

No existing issue. I thought that having two different entry points into the code was not healthy and could lead to bugs.

In-depth Description

The new index.js has the commandline parameters and default values that prod.js had, as well the dev.js config functionality from the old index.js. The merge has a couple of logic changes:

  • --dev or -d flag to force NODE_ENV=development
  • Logging of the NODE_ENV value and of all of the arguments passed to the Server constructor, for better debuggability.

Consequently a couple of additional changes in other places were required:

  • Defining the required default environment variables explicitly in dockerfile (which is also good for readabilty)
  • Switcing from prod.js to index.js, and adding the --dev flag to the dev script in package.json

Note: in the new code, you need to run with NODE_ENV=development or --dev to force development mode, otherwise production is assumed.

How have you tested this?

  • Ran with --dev/-d
  • Built and run docker image with new ENV settings

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3808 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 1/7/2025 **Status:** ✅ Merged **Merged:** 1/8/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `merge-prod-js-index-js` --- ### 📝 Commits (2) - [`d410b13`](https://github.com/advplyr/audiobookshelf/commit/d410b13c9bec41ea9e0d459399325b13a3b1128d) Merge prod.js into index.js - [`052e005`](https://github.com/advplyr/audiobookshelf/commit/052e0059ff52737ca620e38673b5b270f052e267) Restore prod.js ### 📊 Changes **4 files changed** (+36 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+5 -0) 📝 `index.js` (+26 -6) 📝 `package-lock.json` (+1 -1) 📝 `package.json` (+4 -4) </details> ### 📄 Description ## Brief summary Merges prod.js and index.js. ## Which issue is fixed? No existing issue. I thought that having two different entry points into the code was not healthy and could lead to bugs. ## In-depth Description The new index.js has the commandline parameters and default values that prod.js had, as well the dev.js config functionality from the old index.js. The merge has a couple of logic changes: - `--dev` or `-d` flag to force `NODE_ENV=development` - Logging of the `NODE_ENV` value and of all of the arguments passed to the `Server` constructor, for better debuggability. Consequently a couple of additional changes in other places were required: - Defining the required default environment variables explicitly in `dockerfile` (which is also good for readabilty) - Switcing from `prod.js` to `index.js`, and adding the `--dev` flag to the `dev` script in `package.json` _Note:_ in the new code, you need to run with NODE_ENV=development or `--dev` to force development mode, otherwise production is assumed. ## How have you tested this? - Ran with `--dev`/`-d` - Built and run docker image with new ENV settings --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:17 +02:00
adam closed this issue 2026-04-25 00:18:17 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4092