Skip to content

1. Installation

Sergei Kliuikov edited this page May 9, 2025 · 2 revisions

📌 How to Install EasyREST

EasyREST now ships as a single, all‑in‑one binary (easyrest-server) that embeds all official plugins and runs significantly faster by avoiding external plugin RPC overhead. If you prefer a gateway mode (to load only specific or custom plugins), use the easyrest-gateway binary and install plugins alongside it.


⚡ 1. Quick Install: All‑in‑One Server

  1. Detect your platform & architecture:

    uname -m && uname -s
    • x86_64amd64
    • aarch64arm64
    • Linuxlinux
    • MacOSdarwin
  2. Set the BIN_ARCH:

    export BIN_ARCH="$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)"  # e.g. linux-amd64
  3. Download easyrest-server:

    curl -L -o easyrest-server \
      https://github.com/onegreyonewhite/easyrest/releases/latest/download/easyrest-server-$BIN_ARCH
  4. Make it executable:

    chmod +x easyrest-server
  5. Move to your PATH:

    INSTALL_DIR="$HOME/.local/bin"  # or /usr/local/bin
    mkdir -p "$INSTALL_DIR"
    mv easyrest-server "$INSTALL_DIR/"
  6. Verify installation:

    which easyrest-server
    easyrest-server --version

🛡️ 2. Gateway Mode: Selective Plugins

Use gateway mode when you need to load only certain plugins (e.g., deploy a MySQL‑only service) or add custom plugins.

2.1 Download easyrest-gateway

curl -L -o easyrest-gateway \
  https://github.com/onegreyonewhite/easyrest/releases/latest/download/easyrest-gateway-$BIN_ARCH
chmod +x easyrest-gateway

2.2 Download Plugins

All plugins now live in the same repository. Replace PLUGIN with one of: sqlite, mysql, postgres, redis.

for PLUGIN in sqlite mysql postgres redis; do
  curl -L -o easyrest-plugin-$PLUGIN \
    https://github.com/onegreyonewhite/easyrest/releases/latest/download/easyrest-plugin-$PLUGIN-$BIN_ARCH
  chmod +x easyrest-plugin-$PLUGIN
done

Move gateway & plugins into your PATH:

mv easyrest-gateway \
   easyrest-plugin-sqlite \
   easyrest-plugin-mysql \
   easyrest-plugin-postgres \
   easyrest-plugin-redis \
   "$INSTALL_DIR/"

Verify:

easyrest-gateway --version
easyrest-plugin-mysql --version

📁 3. Installation Directory

  • Common targets:
    • /usr/local/bin (requires sudo)
    • $HOME/.local/bin (no sudo)
  • Ensure your PATH includes the install directory:
    export PATH="$INSTALL_DIR:$PATH"

✅ 4. Next Steps

  1. Configure your database connections via YAML or environment variables.
  2. Start the server:
    • All‑in‑One: easyrest-server --config config.yaml
    • Gateway: easyrest-gateway --config config.yaml
  3. Explore the auto‑generated Swagger schema at http://localhost:8080/api/{plugin}/.

🚀 You’re now ready to serve RESTful CRUD endpoints on SQLite, MySQL, PostgreSQL and cache with Redis!

Clone this wiki locally