Skip to content

Commit 96bb69e

Browse files
authored
Update README.md
1 parent 9c0f612 commit 96bb69e

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,25 @@ It works with express.js framework to run Node.js server. Custom renderer we hav
1919

2020
```js
2121
import React from "react";
22-
import ReactExpress from "./renderer";
22+
import { ReactXpress, App, Static, Router, Get, Post } from "../lib";
2323

2424
const HomePage = () => <h1>Welcome to home page</h1>;
2525
const AboutPage = () => <h1>About Company</h1>;
2626

2727
const ExpressApp = () => (
28-
<app port={8080}>
29-
<router path="/">
30-
<get content={<HomePage />} />
31-
<get path="*" content="Not Found" status={404} />
32-
</router>
33-
<router path="/company">
34-
<get path="/about" content={<AboutPage />} />
35-
</router>
36-
<router path="/api">
37-
<post path="/status" content={{ msg: "It is okay, bro" }} />
38-
</router>
39-
</app>
28+
<App port={8080}>
29+
<Static publicPath="/public" />
30+
<Router path="/">
31+
<Get content={<HomePage />} />
32+
<Get path="*" content="Not Found" status={404} />
33+
</Router>
34+
<Router path="/company">
35+
<Get path="/about" content={<AboutPage />} />
36+
</Router>
37+
<Router path="/api">
38+
<Post path="/status" content={{ msg: "It is okay, bro" }} />
39+
</Router>
40+
</App>
4041
);
4142

4243
ReactExpress.render(<ExpressApp />);

0 commit comments

Comments
 (0)