A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.centralmind.ai/docs/content/getting-started/launching-api/ below:

Launching an API | CentralMind

This guide explains how to launch the API you created using the Gateway discovery process.

Prerequisites

Before launching your API, ensure you have:

  1. Gateway installed using one of the installation methods
  2. A generated gateway.yaml configuration file from the API generation process
Starting the REST API Server

Once you have your configuration file, you can start the API server with a simple command:

# Launch the API using your gateway.yaml configuration

./gateway start --config gateway.yaml

Parameter Descriptions: Accessing Your API

After running the command, Gateway will launch a web server with the following default settings:

The Swagger documentation provides a complete interactive reference for all endpoints in your API, allowing you to:

Customizing Server Settings

If you need to customize the server address or port, you can modify the gateway.yaml file or provide command-line overrides:

# Launch on a different port

./gateway start --config gateway.yaml --addr :7000

Managing Secrets with Environment Variables

Gateway supports the use of environment variables in the configuration file through ${VARIABLE_NAME} syntax. This is particularly useful for managing sensitive information like API keys, database credentials, and other secrets.

Using Environment Variables in Configuration

You can use environment variables in your gateway.yaml file like this:

database:

connection:

host: ${DB_HOST}

user: ${DB_USER}

password: ${DB_PASSWORD}

database: ${DB_NAME}

api:

auth:

secret_key: ${API_SECRET_KEY}

When launching the Gateway, ensure these environment variables are set:

# Set environment variables

export DB_HOST=localhost

export DB_USER=myuser

export DB_PASSWORD=mysecret

export DB_NAME=mydb

export API_SECRET_KEY=your-secret-key

# Launch the API

./gateway start --config gateway.yaml

Best Practices for Secrets Management
  1. Never commit sensitive values directly in configuration files
  2. Use environment variables for all sensitive information
  3. Consider using secret management tools in production environments
  4. Keep development and production secrets separate
Launching MCP SSE Server Mode

To start Gateway in MCP (Message Communication Protocol) SSE server mode, use the following command:

# Launch the API in MCP server mode

./gateway start --config gateway.yaml

By default it will be available on address:

http://localhost:9090/sse

MCP Server Parameters:

The MCP server mode allows for efficient message-based communication between services.

Using MCP StdInOut Mode

For scenarios where you need direct input/output communication, you can use the MCP StdInOut mode for example when working with local applications like Claude Desktop or Cursor:

# Launch the API in MCP StdInOut mode

./gateway start --config gateway.yaml mcp-stdio

MCP StdInOut Parameters:

This mode is particularly useful for:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4