Tencent Server Web的介绍及私有部署

官方GitHub地址

中文文档

Tencent Server Web(TSW),是一套面向WEB前端开发者,以提升问题定位效率为初衷,提供染色抓包、全息日志和异常发现的Node.js基础设施。TSW关注业务的运维监控能力,适用于http、websocket协议的业务场景,可无缝与即有应用进行整合。支持公有云、私有云和本地部署。

Examples

官方示例项目可以让大家尽快了解该项目。以下皆在树莓派中运行

  1. mkdir TSW
  2. cd TSW
  3. git clone https://github.com/Tencent/TSW.git
  4. cd examples/koa
  5. yarn
  6. yarn serve 或者 npm run serve
  7. curl -v localhost:4443/path/to/foo -X POST -d "hello, server"

examples/koa/index.js

const Koa = require("koa");
const axios = require("axios");

const app = new Koa();

app.use(async ctx => {
  await axios.get(
    "http://jsonplaceholder.typicode.com/todos/1"
  ).then(res => {
    console.log(res.data);
  });

  await axios.post("http://jsonplaceholder.typicode.com/posts", {
    body: JSON.stringify({
      title: 'foo',
      body: 'bar',
      userId: 1
    }),
    headers: {
      "Content-type": "application/json; charset=UTF-8"
    }
  }).then(res => {
    console.log(res.data);
  });


  ctx.body = "Hello, tsw 2.0";
  ctx.status = 200;
}).listen(4443);

 

 

后续会考虑在下面这个项目中引用

Vue2.0 + Nodejs + Nestjs + Mysql + Nginx全栈开发,项目实战(一):项目简介

评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值