Skip to content

Instantly share code, notes, and snippets.

@frankzickert
Last active September 6, 2019 08:54
Show Gist options
  • Save frankzickert/854d3b5835267a09b9237a536e3cce33 to your computer and use it in GitHub Desktop.
Save frankzickert/854d3b5835267a09b9237a536e3cce33 to your computer and use it in GitHub Desktop.
A simple Isomorphic React App
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