官方GitHub地址
中文檔案
Tencent Server Web(TSW),是一套面向WEB前端開發者,以提升問題定位效率為初衷,提供染色抓包、全息日志和例外發現的Node.js基礎設施,TSW關注業務的運維監控能力,適用于http、websocket協議的業務場景,可無縫與即有應用進行整合,支持公有云、私有云和本地部署,
Examples
官方示例專案可以讓大家盡快了解該專案,以下皆在樹莓派中運行
mkdir TSW- cd TSW
git clonehttps://github.com/Tencent/TSW.gitcd examples/koayarnyarn serve或者npm run servecurl -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全堆疊開發,專案實戰(一):專案簡介
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/271625.html
標籤:區塊鏈
上一篇:通過HTML5構建Web頁
下一篇:位運算優化數獨
