Skip to content

Running the example server

Alan Souza edited this page Jul 23, 2015 · 4 revisions

Inside server folder we have the Node.Js server which is used to host the Grommet.io website and also to server the examples apps.

Assuming you have Grommet successfully built locally, you can use this server to test your local project. This can be useful in your integration tests before sending contributions back to us. If you haven't built Grommet yet, please refer to Grommet Build Wiki first.

As of now, the server provides the following apps:

  • /docs: the main Grommet Website
  • /medium-app:: a more complete tour around Grommet components and patterns
  • /cto-app-tuner: a sample app used to introduce Grommet to the community
  • /hello-world: a very simple Hello World application

Before serving these applications you need to prepare them for production (gulp dist). The default route for this sample server is /docs. So, run the following commands to have the server running in your local environment:

  1. Distribute the apps:
```
$ cd docs
$ gulp dist
$ cd ../examples/medium-app
$ gulp dist
$ cd ../cto-app-tuner
$ gulp dist 
```
  1. Start the medium-app server:
```
$ cd examples/medium-app/server
$ npm install
$ node server.js
```
  1. Start the Grommet server:
```
$ cd server
$ npm install
$ node server.js
```
  1. Test the apps:
* http://localhost:8000/docs/
* http://localhost:8000/medium-app/
* http://localhost:8000/cto-app-tuner/
* http://localhost:8000/hello-world/

Clone this wiki locally