Doubt regarding rasa run --model models --enable-api --cors “*” --debug

Can any one explain why we are adding --enable-api --cors “*” flag in rasa run --model models --enable-api --cors “*” --debug -p $PORT?.

Like I know this command is used to start the rasa server but I haven’t understood the use of cors "*" and enable-api.

From the docs:

  • --cors [CORS ...]: Enable CORS for the passed origin.
  • --enable-api: Start the web server API in addition to the input channel.

If you don’t know what CORS is, check out CORS in 100 Seconds.

--cors "*" basically means you are allowing any URL to make requests to the server. For example:

  • cors "https://example.com/*" means you allow requests from any page on example.com only.
  • cors "https://example.com/chatbot" means you allow requests from example.com/chatbot only.

And --enable-api, well, enables the API.