From 250e5a0c3521037e89ee262a231e0fde25f9e422 Mon Sep 17 00:00:00 2001 From: k8w Date: Sat, 25 Dec 2021 18:30:22 +0800 Subject: [PATCH 1/2] first-api default json: true --- examples/first-api/backend/src/index.ts | 2 +- examples/first-api/frontend/src/index.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/first-api/backend/src/index.ts b/examples/first-api/backend/src/index.ts index 7dcc249..629c240 100644 --- a/examples/first-api/backend/src/index.ts +++ b/examples/first-api/backend/src/index.ts @@ -5,7 +5,7 @@ import { serviceProto } from "./shared/protocols/serviceProto"; // Create the Server const server = new HttpServer(serviceProto, { port: 3000, - cors: '*' + json: true }); // Entry function diff --git a/examples/first-api/frontend/src/index.ts b/examples/first-api/frontend/src/index.ts index 106f145..4203a14 100644 --- a/examples/first-api/frontend/src/index.ts +++ b/examples/first-api/frontend/src/index.ts @@ -4,7 +4,8 @@ import { serviceProto } from './shared/protocols/serviceProto'; // Create the Client let client = new HttpClient(serviceProto, { server: 'http://127.0.0.1:3000', - logger: console + json: true, + // logger: console }); async function test() { From 8d654096562ac6c8670f3c4eb627a0beca8b4418 Mon Sep 17 00:00:00 2001 From: k8w Date: Sat, 25 Dec 2021 18:33:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?backend=20=E5=8A=A0=E5=85=A5=20npm=20run=20?= =?UTF-8?q?doc=20=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/chatroom/backend/package.json | 13 +++++++------ examples/client-mock/backend/package.json | 13 +++++++------ examples/cocos-creator-2.4.7/backend/package.json | 13 +++++++------ examples/cocos-creator-3.3.0/backend/package.json | 13 +++++++------ examples/custom-http-res/package.json | 13 +++++++------ examples/file-upload/backend/package.json | 13 +++++++------ examples/first-api/backend/package.json | 13 +++++++------ examples/layaair/backend/package.json | 13 +++++++------ examples/mongodb-crud/backend/package.json | 13 +++++++------ examples/session-and-cookie/backend/package.json | 13 +++++++------ examples/transfer-encryption/backend/package.json | 13 +++++++------ examples/user-authentication/backend/package.json | 13 +++++++------ 12 files changed, 84 insertions(+), 72 deletions(-) diff --git a/examples/chatroom/backend/package.json b/examples/chatroom/backend/package.json index da02ca7..1b75c1a 100644 --- a/examples/chatroom/backend/package.json +++ b/examples/chatroom/backend/package.json @@ -4,11 +4,12 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", + "build": "tsrpc build" }, "devDependencies": { "@types/node": "^15.14.9", @@ -20,4 +21,4 @@ "dependencies": { "tsrpc": "^3.0.9" } -} +} \ No newline at end of file diff --git a/examples/client-mock/backend/package.json b/examples/client-mock/backend/package.json index dc9a17b..f86bd9a 100644 --- a/examples/client-mock/backend/package.json +++ b/examples/client-mock/backend/package.json @@ -4,11 +4,12 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", + "build": "tsrpc build" }, "devDependencies": { "@types/node": "^15.14.9", @@ -20,4 +21,4 @@ "dependencies": { "tsrpc": "^3.0.9" } -} +} \ No newline at end of file diff --git a/examples/cocos-creator-2.4.7/backend/package.json b/examples/cocos-creator-2.4.7/backend/package.json index ec6b3b4..41f715f 100644 --- a/examples/cocos-creator-2.4.7/backend/package.json +++ b/examples/cocos-creator-2.4.7/backend/package.json @@ -4,11 +4,12 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", + "build": "tsrpc build" }, "devDependencies": { "@types/node": "^15.14.9", @@ -20,4 +21,4 @@ "dependencies": { "tsrpc": "^3.1.2" } -} +} \ No newline at end of file diff --git a/examples/cocos-creator-3.3.0/backend/package.json b/examples/cocos-creator-3.3.0/backend/package.json index ec6b3b4..41f715f 100644 --- a/examples/cocos-creator-3.3.0/backend/package.json +++ b/examples/cocos-creator-3.3.0/backend/package.json @@ -4,11 +4,12 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", + "build": "tsrpc build" }, "devDependencies": { "@types/node": "^15.14.9", @@ -20,4 +21,4 @@ "dependencies": { "tsrpc": "^3.1.2" } -} +} \ No newline at end of file diff --git a/examples/custom-http-res/package.json b/examples/custom-http-res/package.json index 4efc99f..70d2f02 100644 --- a/examples/custom-http-res/package.json +++ b/examples/custom-http-res/package.json @@ -4,12 +4,13 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", "test": "mocha test/**/*.test.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "build": "tsrpc build" }, "devDependencies": { "@types/mocha": "^8.2.3", @@ -23,4 +24,4 @@ "dependencies": { "tsrpc": "^3.0.9" } -} +} \ No newline at end of file diff --git a/examples/file-upload/backend/package.json b/examples/file-upload/backend/package.json index cbfcfe7..ebc10a1 100644 --- a/examples/file-upload/backend/package.json +++ b/examples/file-upload/backend/package.json @@ -4,11 +4,12 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", + "build": "tsrpc build" }, "devDependencies": { "@types/node": "^15.14.9", @@ -20,4 +21,4 @@ "dependencies": { "tsrpc": "^3.0.9" } -} +} \ No newline at end of file diff --git a/examples/first-api/backend/package.json b/examples/first-api/backend/package.json index cbfcfe7..ebc10a1 100644 --- a/examples/first-api/backend/package.json +++ b/examples/first-api/backend/package.json @@ -4,11 +4,12 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", + "build": "tsrpc build" }, "devDependencies": { "@types/node": "^15.14.9", @@ -20,4 +21,4 @@ "dependencies": { "tsrpc": "^3.0.9" } -} +} \ No newline at end of file diff --git a/examples/layaair/backend/package.json b/examples/layaair/backend/package.json index 9be327a..6ac0725 100644 --- a/examples/layaair/backend/package.json +++ b/examples/layaair/backend/package.json @@ -4,11 +4,12 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", + "build": "tsrpc build" }, "devDependencies": { "@types/node": "^15.14.9", @@ -20,4 +21,4 @@ "dependencies": { "tsrpc": "^3.0.9" } -} +} \ No newline at end of file diff --git a/examples/mongodb-crud/backend/package.json b/examples/mongodb-crud/backend/package.json index 2fc9dfd..b52ba9c 100644 --- a/examples/mongodb-crud/backend/package.json +++ b/examples/mongodb-crud/backend/package.json @@ -4,11 +4,12 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", + "build": "tsrpc build" }, "devDependencies": { "@types/mocha": "^8.2.3", @@ -24,4 +25,4 @@ "mongodb": "^3.7.2", "tsrpc": "^3.0.9" } -} +} \ No newline at end of file diff --git a/examples/session-and-cookie/backend/package.json b/examples/session-and-cookie/backend/package.json index c851e7f..2b269b1 100644 --- a/examples/session-and-cookie/backend/package.json +++ b/examples/session-and-cookie/backend/package.json @@ -4,11 +4,12 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", + "build": "tsrpc build" }, "devDependencies": { "@types/node": "^15.14.9", @@ -22,4 +23,4 @@ "tsrpc": "^3.0.9", "uuid": "^8.3.2" } -} +} \ No newline at end of file diff --git a/examples/transfer-encryption/backend/package.json b/examples/transfer-encryption/backend/package.json index de48fc3..9ca71e6 100644 --- a/examples/transfer-encryption/backend/package.json +++ b/examples/transfer-encryption/backend/package.json @@ -4,11 +4,12 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", + "build": "tsrpc build" }, "devDependencies": { "@types/node": "^15.14.9", @@ -20,4 +21,4 @@ "dependencies": { "tsrpc": "^3.0.9" } -} +} \ No newline at end of file diff --git a/examples/user-authentication/backend/package.json b/examples/user-authentication/backend/package.json index 379cbf9..42750e5 100644 --- a/examples/user-authentication/backend/package.json +++ b/examples/user-authentication/backend/package.json @@ -4,11 +4,12 @@ "main": "index.js", "private": true, "scripts": { - "proto": "tsrpc proto --config tsrpc.config.ts", - "sync": "tsrpc sync --config tsrpc.config.ts", - "api": "tsrpc api --config tsrpc.config.ts", - "dev": "tsrpc dev --config tsrpc.config.ts", - "build": "tsrpc build --config tsrpc.config.ts" + "proto": "tsrpc proto", + "sync": "tsrpc sync", + "api": "tsrpc api", + "doc": "tsrpc doc", + "dev": "tsrpc dev", + "build": "tsrpc build" }, "devDependencies": { "@types/node": "^15.14.9", @@ -22,4 +23,4 @@ "tsrpc": "^3.0.9", "uuid": "^8.3.2" } -} +} \ No newline at end of file