Skip to content

Latest commit

History

History
100 lines (58 loc) 路 2.77 KB

run.md

File metadata and controls

100 lines (58 loc) 路 2.77 KB

jovo run

Learn how to use the jovo run command of the Jovo CLI to test your code locally.

Introduction

jovo run command

You can use the jovo run command to start the development server in your index.js file (default is port 3000), and then point the Jovo Webhook to it.

# Default
$ jovo run

# Options
$ jovo run [-b | --bst-proxy] [-w | --watch] [-p, --port <port>] [--inspect] [--stage <stage>] [--webhook-only]
  [--disable-jovo-debugger] [--model-test] [--timeout <timeout>] [-r | --record <name>]

You can also specify the file you want to run:

$ jovo run <file>

# Example
$ jovo run src/index.js

# Alternative
$ node src/index.js --webhook --cwd ./src

Options

--port, -p: Defines the port that will be used to run the local development server. Default: 3000.

--inspect: Run debugging mode.

--stage: Specify the stage where the configuration will be taken from.

--webhook-only: Starts the Jovo webhook proxy without executing the code.

--disable-jovo-debugger: Disables the Jovo debugger.

--model-test: Activates the language model test.

--timeout: Sets timeout in milliseconds.

--record, -r: Can be used to record requests and responses of your Jovo app for testing purposes.

--cwd: Changes the current working directory of the source code. Typically, it would be ./src.

Integrations

If you want to see another integration, please feel free to submit an issue. Thanks!

Here is a list of integrations that work with jovo run:

Command Description
--bst-proxy Creates a webhook URL for local testing and integrates with Bespoken Analytics
--watch Uses nodemon to monitor changes and automatically restart the server

bst proxy

You can use the bst proxy to create a webhook URL easily:

$ jovo run --bst-proxy

The result should look like this:

Jovo and bst proxy

The URL also comes with logging and analytics capabilities for prototyping and testing.

nodemons

With this integration, you don't have to manually restart your server with every change you make to the application:

$ jovo run --watch

For this, we're using nodemon, a neat package that monitors your app files and automatically restarts the server.