2.0.18 • Published 3 years ago

console-core-portal-koa-server v2.0.18

Weekly downloads
60
License
ISC
Repository
-
Last release
3 years ago

Description

This is an lib for pccwglobal Team PO, to support the FE server. It will provider some base function and start a koa server.

How to use it?

we provider a npm command spa-server;

you can use it like this:

 spa-server -p 8080 -n portal-cpq

-p mean port, -n mean name which will be used in Consul.

spa-server

  • how it works?

    after you run spa-server -p 8080 -n portal-cpq, it will start a node server(we use koa) with port 8080, the static file path is /dist so you need the folder /dist in you own project root path.

    it will connect to Consul 'http://consul-server', port 8500, watch the config. when get notification from Consul, it will run command npm run build.

endpoints

/status GET

return the building status

  start:'start building',
  building:'building',
  done:'build done',
  error:'error',
  startKill:'start kill',
  killed:'killed',
  working:'server on',
/heartbeat GET

return the /dist/heartbeat.json

{
  "name": "@console/console-core-portal-order",
  "version": "0.0.0",
  "relatedAt": "",
  "description": "Sherpa Portal Order",
  "status": "UP"
}
/consul GET

return the consul config and status

    repoName: consul.repoName,
    firstBuild: consul.firstBuild,
    buildStatus: global.buildStatus,
    watchStatus: consul.watchStatus,
/consul POST

it will run consul.watchConsul(), will try bind the watch in consul.then return the consul config and status

    repoName: consul.repoName,
    firstBuild: consul.firstBuild,
    buildStatus: global.buildStatus,
    watchStatus: consul.watchStatus,

Koa

Consul

Automate network configurations, discover services, and enable secure connectivity across any cloud or runtime.

TODO

- read the from project root path .env file

- provider the Consul config,like server url

2.0.16

3 years ago

2.0.17

3 years ago

2.0.18

3 years ago

2.0.15

3 years ago

2.0.14

3 years ago

2.0.13

3 years ago

2.0.12

3 years ago

2.0.11

3 years ago

2.0.9

3 years ago

2.0.10

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago