npm install
npm start
A new browser window should automatically open.
But, if it doesn’t then use:
http://localhost:3000
This launches a development environment that instantly reloads any changes to the browser for rapid development.
When developing, is usual to run this application outside of swscore.
Is possible to proxy the API requests without having to push the changes to swscore.
Add the proxy
property to package.json
with the url of the swscore.
{
"name": "swsui",
"version": "0.2.1",
"proxy": "http://sws-istio-system.127.0.0.1.nip.io",
"bugs": {
...
Run npm start
and try it!
$ curl -u jdoe:password http://localhost:3000/api
Namespaces: [default istio-system kube-public kube-system myproject openshift openshift-infra openshift-node]
Namespace: default Services [docker-registry kubernetes router]
Service Name: docker-registry
Service Labels:
docker-registry = default
Type: ClusterIP
...
Warning
|
The proxy will only serve requests without the text/html accept header, using the browser directly won’t work. |
Use npm run build
which will bundle the build artifacts using webpack into the build
directory.
-
src
: Source and test code -
src/assets
: Images and other assets -
src/components
: Stateless components (pure functions) -
src/containers
: Stateful (smart) components -
src/hoc
: High order Components -
src/pages
: Top level pages and nested components -
stories
: Storybook files -
build
: Production build output -
public
: home of index.html
PatternFly is the main UI components framework. It defines style based on SASS preprocessor.
All Patternfly build assets are copied to src
. The App.scss
file will include all PatternFly Sass along with
PatternFly React Sass extensions. Once Sass compiles, the resulting CSS can be found in src/css/App.css
.
Note:
Only static assets which are import
'ed into your application will be included in your resulting build output.
This project was bootstrapped with create-react-app
See the LICENSE file.