Servest:一种用于Deno的渐进式HTTP服务器

2020-05-14 15:23:33

//来自";的@deno-types=";https://servestjs.org/@v1.0.0-rc4/types/react/index.d.ts";import Reaction来自";https://dev.jspm.io/react/index.js";;//@deno-types=";https://servestjs.org/@v1.0.0-rc4/types/react-dom/server/index.d.ts";import ReactDOMServer;https://dev.jspm.io/react-dom/server.js";;import{CreateApp}来自";https://servestjs.org/@v1.0.0-rc4/mod.ts";;const APP=CreateApp();app.Handle(";/";,Async(Req)=>;{等待请求.Response({状态:200,标题:新标题({";内容类型";:";文本/HTML;字符集=UTF-8";,}),Body:ReactDOMServer.renderToString(<;html>;<;head>;<;meta charset=";utf-8";/>;<;title>;Servest<;/title>;<;/head>;<;body>;Hello Servest!<;/body>;<