@fuzionx/framework 0.1.6 → 0.1.7
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 +7 -2
- package/lib/core/Application.js +31 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,13 +13,18 @@
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
+
# 글로벌 CLI 설치 (fx + create-fuzionx)
|
|
17
|
+
npm install -g create-fuzionx
|
|
18
|
+
|
|
16
19
|
# 프로젝트 생성
|
|
17
|
-
|
|
20
|
+
fx new my-app
|
|
21
|
+
# 또는: npx create-fuzionx my-app
|
|
22
|
+
|
|
18
23
|
cd my-app
|
|
19
24
|
npm install
|
|
20
25
|
|
|
21
26
|
# 개발 서버
|
|
22
|
-
|
|
27
|
+
fx dev # 또는: npx fx dev
|
|
23
28
|
|
|
24
29
|
# 또는 직접 실행
|
|
25
30
|
node app.js
|
package/lib/core/Application.js
CHANGED
|
@@ -296,6 +296,10 @@ export default class Application {
|
|
|
296
296
|
port = port || this.config.get('bridge.server.port', 3000);
|
|
297
297
|
|
|
298
298
|
if (!this._booted) await this.boot();
|
|
299
|
+
|
|
300
|
+
// 포트 사용 여부 확인 — 충돌 시 명확한 에러
|
|
301
|
+
await this._checkPort(port);
|
|
302
|
+
|
|
299
303
|
await this.emit('ready');
|
|
300
304
|
|
|
301
305
|
// Bridge 연동
|
|
@@ -333,6 +337,33 @@ export default class Application {
|
|
|
333
337
|
return this;
|
|
334
338
|
}
|
|
335
339
|
|
|
340
|
+
/**
|
|
341
|
+
* 포트 사용 여부 확인 — 이미 바인딩된 포트면 명확한 에러
|
|
342
|
+
* @param {number} port
|
|
343
|
+
* @private
|
|
344
|
+
*/
|
|
345
|
+
async _checkPort(port) {
|
|
346
|
+
const net = await import('node:net');
|
|
347
|
+
return new Promise((resolve, reject) => {
|
|
348
|
+
const tester = net.createServer()
|
|
349
|
+
.once('error', (err) => {
|
|
350
|
+
if (err.code === 'EADDRINUSE') {
|
|
351
|
+
reject(new Error(
|
|
352
|
+
`❌ 포트 ${port}이(가) 이미 사용 중입니다. ` +
|
|
353
|
+
`다른 FuzionX 인스턴스가 실행 중인지 확인하세요.\n` +
|
|
354
|
+
` 확인: lsof -i :${port} | 종료: fuser -k ${port}/tcp`
|
|
355
|
+
));
|
|
356
|
+
} else {
|
|
357
|
+
reject(err);
|
|
358
|
+
}
|
|
359
|
+
})
|
|
360
|
+
.once('listening', () => {
|
|
361
|
+
tester.close(() => resolve());
|
|
362
|
+
})
|
|
363
|
+
.listen(port, '0.0.0.0');
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
|
|
336
367
|
/**
|
|
337
368
|
* 싱글톤 컨트롤러 초기화
|
|
338
369
|
* @private
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzionx/framework",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Full-stack MVC framework built on @fuzionx/core — Controller, Service, Model, Middleware, DI, EventBus",
|
|
6
6
|
"main": "index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"url": "https://github.com/saytohenry/fuzionx"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@fuzionx/core": "^0.1.
|
|
37
|
+
"@fuzionx/core": "^0.1.7",
|
|
38
38
|
"better-sqlite3": "^12.8.0",
|
|
39
39
|
"knex": "^3.2.5",
|
|
40
40
|
"mongoose": "^9.3.2",
|