deno.land / x / abc@v1.3.3 / examples / jsx / main.jsx

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import React from "https://dev.jspm.io/react";import ReactDOMServer from "https://dev.jspm.io/react-dom/server";import { Application } from "../../mod.ts";
const app = new Application();
app.use((next) => (c) => { let e = next(c); if (React.isValidElement(e)) { e = ReactDOMServer.renderToString(e); }
return e; });
app.get("/", () => { return <h1>Hello</h1>;}) .start({ port: 8080 });
console.log(`server listening on http://localhost:8080`);
abc

Version Info

Tagged at
4 years ago