@hamjimin/xplat-back 0.6.0 → 0.6.2
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 +10 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# xplat-back
|
|
1
|
+
# @hamjimin/xplat-back
|
|
2
2
|
|
|
3
3
|
Express + TypeScript 백엔드 스캐폴딩 도구 (zium-backend 기반)
|
|
4
4
|
|
|
@@ -15,22 +15,22 @@ Express + TypeScript 백엔드 스캐폴딩 도구 (zium-backend 기반)
|
|
|
15
15
|
## 설치
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm install xplat-back
|
|
18
|
+
npm install @hamjimin/xplat-back
|
|
19
19
|
# 또는
|
|
20
|
-
yarn add xplat-back
|
|
20
|
+
yarn add @hamjimin/xplat-back
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 빠른 시작
|
|
24
24
|
|
|
25
25
|
### CLI를 통한 프로젝트 초기화
|
|
26
26
|
```bash
|
|
27
|
-
npx xplat-back [project-name]
|
|
27
|
+
npx @hamjimin/xplat-back [project-name]
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
옵션:
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
npx xplat-back my-project --port 3000 --cors "http://localhost:3000,http://localhost:5173"
|
|
33
|
+
npx @hamjimin/xplat-back my-project --port 3000 --cors "http://localhost:3000,http://localhost:5173"
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
사용 가능한 옵션:
|
|
@@ -38,13 +38,14 @@ npx xplat-back my-project --port 3000 --cors "http://localhost:3000,http://local
|
|
|
38
38
|
- `-c, --cors <origins>`: CORS 허용 origins (쉼표로 구분)
|
|
39
39
|
- `-r, --router-dir <directory>`: 라우터 디렉토리 (기본값: src/restapi)
|
|
40
40
|
- `--router-path <path>`: 라우터 base path (기본값: /restapi)
|
|
41
|
+
- `--with-next`: Next.js 프론트엔드(web) 템플릿 추가
|
|
41
42
|
|
|
42
43
|
### 수동 설정
|
|
43
44
|
|
|
44
45
|
#### 1. 패키지 설치
|
|
45
46
|
|
|
46
47
|
```bash
|
|
47
|
-
npm install express xplat-back
|
|
48
|
+
npm install express @hamjimin/xplat-back
|
|
48
49
|
npm install -D typescript @types/express @types/node ts-node tsconfig-paths
|
|
49
50
|
```
|
|
50
51
|
|
|
@@ -55,7 +56,7 @@ npm install -D typescript @types/express @types/node ts-node tsconfig-paths
|
|
|
55
56
|
```typescript
|
|
56
57
|
import express, { Application } from 'express';
|
|
57
58
|
import * as path from 'path';
|
|
58
|
-
import { createApp } from 'xplat-back';
|
|
59
|
+
import { createApp } from '@hamjimin/xplat-back';
|
|
59
60
|
|
|
60
61
|
const app: Application = createApp({
|
|
61
62
|
cors: {
|
|
@@ -140,7 +141,7 @@ interface AppConfig {
|
|
|
140
141
|
#### 예제
|
|
141
142
|
|
|
142
143
|
```typescript
|
|
143
|
-
import { createApp } from 'xplat-back';
|
|
144
|
+
import { createApp } from '@hamjimin/xplat-back';
|
|
144
145
|
|
|
145
146
|
const app = createApp({
|
|
146
147
|
cors: {
|
|
@@ -172,7 +173,7 @@ const app = createApp({
|
|
|
172
173
|
#### 예제
|
|
173
174
|
|
|
174
175
|
```typescript
|
|
175
|
-
import { createRouter } from 'xplat-back';
|
|
176
|
+
import { createRouter } from '@hamjimin/xplat-back';
|
|
176
177
|
import * as path from 'path';
|
|
177
178
|
|
|
178
179
|
const router = createRouter(path.join(__dirname, 'restapi'));
|