1 |
|
2 | # Infrastructure-Components
|
3 |
|
4 | Infrastructure-Components configure the infrastructure of your React-App as part of your React-Components.
|
5 |
|
6 | This piece of code is all you need to create, build, and deploy a **Serverless Isomorphic React App**!
|
7 |
|
8 | ```
|
9 | /** index.tsx */
|
10 | import * as React from 'react';
|
11 |
|
12 | import {
|
13 | IsomorphicApp,
|
14 | WebApp,
|
15 | Route
|
16 | } from "infrastructure-components";
|
17 |
|
18 | export default (
|
19 | <IsomorphicApp
|
20 | stackName = "my-isomorphic-app"
|
21 | buildPath = 'build'
|
22 | assetsPath = 'assets'
|
23 | region='us-east-1'>
|
24 |
|
25 | <WebApp
|
26 | id="main"
|
27 | path="*"
|
28 | method="GET">
|
29 |
|
30 | <Route
|
31 | path='/'
|
32 | name='My Serverless Isomorphic React App'
|
33 | render={(props) => <div>Hello World</div>}
|
34 | />
|
35 |
|
36 | </WebApp>
|
37 | </IsomorphicApp>);
|
38 | ```
|
39 |
|
40 | [This repository](https://github.com/infrastructure-components/isomorphic_example) provides a working example
|
41 | of a Serverless Isomorphic React App with Infrastructure-Components.
|
42 |
|
43 |
|
44 | ## Installation
|
45 |
|
46 | You can install [infrastructure-components](https://github.com/infrastructure-components/infrastructure-components) easily
|
47 |
|
48 | ```
|
49 | npm install --save infrastructure-components
|
50 | ```
|
51 |
|
52 |
|
53 | [infrastructure-scripts](https://github.com/infrastructure-components/infrastructure-scripts)
|
54 | provide all the scripts required to `build`, `start`, and `deploy`. This lib contains many libraries that you only
|
55 | need during development/deployment. Thus, install this library as devDependency::
|
56 |
|
57 | ```
|
58 | npm install --save-dev infrastructure-scripts
|
59 | ```
|
60 |
|
61 | Infrastructure-components use the `Serverless framework <https://serverless.com/>`_ that you need to install globally::
|
62 |
|
63 | ```
|
64 | npm install -g serverless
|
65 | ```
|
66 |
|
67 | Finally, apps (e.g. single-page-app, isomorphic-app) and components (environment, webapp) can have further dependencies.
|
68 | Have a look at them in [our documentation](https://infrastructure-components.readthedocs.io).
|
69 |
|
70 |
|
71 | ## Help and Support
|
72 |
|
73 | Have a look at our [documentation](https://infrastructure-components.readthedocs.io).
|
74 |
|
75 | Infrastructure-Components are under active development. If you find a bug or need support of any kind,
|
76 | please have a look at our [Spectrum-Chat](https://spectrum.chat/infrastructure).
|
77 |
|
78 | Further, we frequently publish descriptions and tutorials on new features on [Medium.com](https://medium.com/@fzickert). |
\ | No newline at end of file |