tcf-router
TypeScript icon, indicating that this package has built-in type declarations

0.0.35 • Public • Published

TCB Express-Like Router

利用腾讯云开发的云函数功能,部署自己的公网云服务。像用Express开发Web服务一样简单,并且提供了本地debug工具,该工具同样可以用于部署在服务器上。

How to create & build

Install

npm install tcf-router -g
// or
yarn global add tcf-router

Create Project

tcf new my-tcf-project

(optional)Create another cloud function

tcf create

Run

tcf dev

Now you can see what happened in your browser

Config your local service

{
  "appPath": "./functions", // the functions' dir path
  "functionEnvVariables": {
    "STAGE": "LOCAL"  // these info will be saved in the environment, you can use process.env.XXX to get
  },
  "context": {  // mock the data of context
    "appId": "wx7ce310ee1e4efd39",
    "uin": "mockuintinkcai831",
    "envId": "local"
  },
  "devServer": {
    "port": 8081,
    "https": false  // https could be {cert: '', key, ''} if you want https
  }
}

TODO

  • layer management(Create/Version)

CI/CD integration (WIP)

  • secretID/Key config file management
  • before/after deployment hooks
  • check & deploy
  • gitlab-ci.yml template
  • visibility of functions
  • execution of functions

Package Sidebar

Install

npm i tcf-router

Weekly Downloads

327

Version

0.0.35

License

ISC

Unpacked Size

144 kB

Total Files

62

Last publish

Collaborators

  • tinkcai