Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 2.75 KB

3. running-a-sample-or-storybook.md

File metadata and controls

73 lines (53 loc) · 2.75 KB

Contribution Guide

  1. Getting Set up
  2. Building Samples and Packages
  3. Running a Sample or Storybook
  4. Testing your changes
  5. Writing unit tests
  6. Submitting a PR
  7. Having your changes published

3. Running a Sample or Storybook

Running the Calling Sample

To run the Calling sample first input your Azure resource connection string.

  • Under samples\Server\appsettings.json.sample, copy this file and remove the .sample extension, then replace "REPLACE_WITH_CONNECTION_STRING" with your connection string.

Then navigate to the sample directory and type the run command:

# Navigate to the sample directories `Calling`
cd samples\Calling

# Start the sample
rushx start

Running the Chat Sample

To run the Chat sample under samples\Server\appsettings.json.sample copy this file and remove the .sample extension, then replace:

  • "REPLACE_WITH_CONNECTION_STRING" with your connection string.
  • "REPLACE_WITH_ENDPOINT_URL" with your endpoint.
  • "REPLACE_WITH_ADMIN_USER_ID" with your users identity.

Then navigate to the sample directory and type the run command:

# Navigate to the sample directories `Chat`
cd samples\Chat

# Start the sample
rushx start

Running a sample kicks off a number of commands:

  1. Starts the Sample's webpack-dev-server
    • This hosts the app by default at localhost:3000
  2. Starts the Sample's API server
    • This server is located Samples/server
    • This runs by default at localhost:8080
  3. Starts a dependency build:watch command to hot reload any changes made to packages.

Once the webpack-dev-server has started it should open the webpage for the sample, and once the sample has finished building the webpage will finish loading and the sample will be ready.

note: this may take a long time the first time it runs

Running Storybook

If you are making changes to the pure UI components, you will want to verify your changes in Storybook. You may also have to update the corresponding story for that UI component inside Storybook.

To run Storybook navigate to the storybook directory and run the storybook start command (this will be build Storybook's dependencies and start the Storybook):

# Navigate to the storybook directory
cd packages\storybook8

# Start Storybook
rushx start

When rushx start completes you should be able to view the storybook at: http://localhost:6006/