Last active
September 6, 2019 08:54
-
-
Save frankzickert/854d3b5835267a09b9237a536e3cce33 to your computer and use it in GitHub Desktop.
A simple Isomorphic React App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
import { | |
Environment, | |
IsomorphicApp, | |
Middleware, | |
Route, | |
WebApp, | |
} from "infrastructure-components"; | |
export default ( | |
<IsomorphicApp | |
stackName = "my-isomorphic-app" | |
buildPath = 'build' | |
assetsPath = 'assets' | |
region='eu-west-1'> | |
<Environment name="dev"/> | |
<WebApp | |
id="main" | |
path="*" | |
method="GET"> | |
<Middleware | |
callback={(req, res, next) => { | |
console.log("this middleware runs on the server"); | |
next(); | |
}} | |
/> | |
<Route | |
path='/' | |
name='My Isomorphic App' | |
render={(props) => <div>I support server side rendering!</div>} | |
/> | |
</WebApp> | |
</IsomorphicApp> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment