@drocketxx/pm2me 1.1.10 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/routes/api.js +16 -0
- package/package.json +1 -1
package/backend/routes/api.js
CHANGED
|
@@ -955,6 +955,22 @@ router.get('/setup/status', async (req, res) => {
|
|
|
955
955
|
}
|
|
956
956
|
});
|
|
957
957
|
|
|
958
|
+
// GET /api/setup/info — returns server OS and default paths (no auth required)
|
|
959
|
+
router.get('/setup/info', (req, res) => {
|
|
960
|
+
const serverIsWindows = os.platform() === 'win32';
|
|
961
|
+
const defaultPath = serverIsWindows ? 'C:\\pm2me\\apps' : '/opt/pm2me/apps';
|
|
962
|
+
const pathPresets = serverIsWindows
|
|
963
|
+
? ['C:\\pm2me\\apps', 'C:\\Users\\apps', 'D:\\pm2me\\apps']
|
|
964
|
+
: ['/opt/pm2me/apps', '/home/apps', '/var/pm2me/apps'];
|
|
965
|
+
|
|
966
|
+
res.json({
|
|
967
|
+
os: serverIsWindows ? 'windows' : 'linux',
|
|
968
|
+
isWindows: serverIsWindows,
|
|
969
|
+
defaultPath,
|
|
970
|
+
pathPresets
|
|
971
|
+
});
|
|
972
|
+
});
|
|
973
|
+
|
|
958
974
|
// POST /api/setup/complete — no auth required
|
|
959
975
|
router.post('/setup/complete', async (req, res) => {
|
|
960
976
|
try {
|