blockmine 1.0.0 → 1.0.6

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/README.md CHANGED
@@ -5,8 +5,8 @@
5
5
  <strong>Мощная и удобная панель управления для ваших Minecraft-ботов на базе Mineflayer.</strong>
6
6
  </p>
7
7
  <p>
8
- <img src="https://img.shields.io/github/stars/mmeerrkkaa/blockmine?style=for-the-badge&logo=github" alt="Stars">
9
- <img src="https://img.shields.io/github/last-commit/mmeerrkkaa/blockmine?style=for-the-badge&logo=git" alt="Last Commit">
8
+ <img src="https://img.shields.io/github/stars/blockmineJS/blockmine?style=for-the-badge&logo=github" alt="Stars">
9
+ <img src="https://img.shields.io/github/last-commit/blockmineJS/blockmine?style=for-the-badge&logo=git" alt="Last Commit">
10
10
  </p>
11
11
  </div>
12
12
 
@@ -75,6 +75,9 @@ BlockMine — это open-source решение для централизова
75
75
  ```
76
76
  3. Готово! Скрипт автоматически скачает все необходимое, настроит базу данных и запустит сервер.
77
77
 
78
+ Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
79
+ > ⚠️ **Важно**: Если выскакивает ошибка - Невозможно загрузить файл C:\Program Files\nodejs\npx.ps1, так как выполнение сценариев отключено в этой системе. - Выполните `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`
80
+
78
81
  После успешного запуска вы увидите в консоли:
79
82
  ```
80
83
  Панель управления доступна по адресу: http://localhost:3001
@@ -91,7 +94,7 @@ BlockMine — это open-source решение для централизова
91
94
 
92
95
  ```bash
93
96
  # 1. Клонировать репозиторий
94
- git clone https://github.com/mmeerrkkaa/blockmine.git
97
+ git clone https://github.com/blockmineJS/blockmine.git
95
98
  cd blockmine
96
99
 
97
100
  # 2. Установить все зависимости для всех частей проекта (backend, frontend)
package/backend/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  const fs = require('fs');
3
3
  const path = require('path');
4
4
  const { execSync } = require('child_process');
@@ -31,4 +31,4 @@
31
31
  "nodemon": "^3.1.2",
32
32
  "prisma": "^5.14.0"
33
33
  }
34
- }
34
+ }
@@ -1,3 +1,4 @@
1
+
1
2
  const express = require('express');
2
3
  const http = require('http');
3
4
  const path = require('path');
@@ -8,7 +9,6 @@ const pluginRoutes = require('./api/routes/plugins');
8
9
  const serverRoutes = require('./api/routes/servers');
9
10
  const permissionsRoutes = require('./api/routes/permissions');
10
11
 
11
-
12
12
  const app = express();
13
13
  const server = http.createServer(app);
14
14
 
@@ -18,10 +18,12 @@ const PORT = process.env.PORT || 3001;
18
18
 
19
19
  app.use(express.json());
20
20
 
21
+ const frontendPath = path.join(__dirname, '..', '..', 'frontend', 'dist');
22
+ const rootPath = path.join(__dirname, '..', '..');
21
23
 
22
24
  app.get('/api/version', async (req, res) => {
23
25
  try {
24
- const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
26
+ const packageJsonPath = path.join(rootPath, 'package.json');
25
27
  const packageJsonData = await fs.readFile(packageJsonPath, 'utf-8');
26
28
  const { version } = JSON.parse(packageJsonData);
27
29
  res.json({ version });
@@ -37,13 +39,13 @@ app.use('/api/servers', serverRoutes);
37
39
  app.use('/api/permissions', permissionsRoutes);
38
40
 
39
41
 
40
- const frontendPath = path.join(__dirname, '..', '..', 'frontend', 'dist');
41
42
  app.use(express.static(frontendPath));
42
43
 
43
44
  app.get(/^(?!\/api).*/, (req, res) => {
44
45
  res.sendFile(path.join(frontendPath, 'index.html'), (err) => {
45
46
  if (err) {
46
- res.status(500).send(err);
47
+ console.error(`Ошибка при отправке index.html:`, err);
48
+ res.status(500).send("Не удалось загрузить приложение.");
47
49
  }
48
50
  });
49
51
  });