GitXplorerGitXplorer
k

openHarmony-thrift-demo

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
4dea4e1b39d3eb5c2160478aebdc18af4c7faea7

Merge branch 'main' of https://github.com/konpeki622/openHarmony-thrift-demo

kkonpeki622 committed 3 years ago
Unverified
19f7363509d5953b412d58ccb46cc06f87907d05

feat: npm link description

kkonpeki622 committed 3 years ago
Verified
c37e441734d590c61983870404b2f489cf48db73

Update README.md

kkonpeki622 committed 3 years ago
Unverified
073fb4eb8b1219ac830923388e3dbebe6516687f

feat: update server & client

kkonpeki622 committed 3 years ago
Verified
aff4e4535ce64955523bddd6d728d1e19726896c

Update README.md

kkonpeki622 committed 3 years ago
Verified
82f4fa2a7145d693f34540b58fe9cd115a3b97c1

Update README.md

kkonpeki622 committed 3 years ago

README

The README file for this repository.

openHarmony-thrift-demo

Demo for thrift applied to OpenHarmonyOS.

Start Server

> cd server
> npm i
> npm run start

The OpenHarmonyOS simulator can not access local host like localhost or 127.0.0.1, so we should do Intranet penetration with tools such as ngrok and use the new address like http://60d3-139-159-170-4.ngrok.io.

Start Client

> cd client/entry
> npm i
# after running 'npm link' in 'thrift' folder
> npm link thrift

Then open the client folder with DevEco Studio, change the host value defined in index.js and config.json to your new address.

// src/main/js/default/pages/index/index.js
const host = 'http://60d3-139-159-170-4.ngrok.io'; //your host address
// src/main/config.js
"default": {
  "network": {
    "cleartextTraffic": true,
    "securityConfig": {
      "domainSettings": {
        "cleartextPermitted": true,
        "domains": [
          {
            "subdomains": true,
            "name": "60d3-139-159-170-4.ngrok.io" //your host address
          }
        ]
      }
    }
  }
}

To Start it, you need to install a phone simulator with API 6. Run it and click the create button, we will get correct data by thrift requesting.