Skip to content

Conversation

@gigantz
Copy link
Collaborator

@gigantz gigantz commented Feb 8, 2021

Now it looks like this

import { ReactXpress, App, Static, Router, Get, Post } from "../lib";

const ExpressApp = () => (
  <App port={process.env.PORT || 8080}>
    <Static publicPath="/public" />
    <Router path="/">
      <Get content={HomePage} />
      <Router path="/components">
        <Get content={ComponentsPage} />
      </Router>
      <Router path="/api">
        <Post path="/status" content={{ msg: "It is okay, bro" }} />
      </Router>
      <Get path="*" content="Not Found" status={404} />
    </Router>
  </App>
);

@gigantz gigantz merged commit 9c0f612 into master Feb 8, 2021
@gigantz gigantz deleted the ojr/components-types branch February 8, 2021 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants