W3DB. How to Configure?

The configiration of W3DB is done via environment variables:

Environment Variable Description
LICENSE_NAME The name of the person/company holding the license. This information is available in your customer panel.
LICENSE_KEY The license key for W3DB. This information is available in your customer portal.
APP_URL The url of the application (i.e. http://localhost:34432)
SERVER_HOST The hostname where W3DB will be listening at. Usually localhost or 127.0.0.1
SERVER_PORT The port where W3DB will be listening at
API_KEYS The API keys for accessing the W3DB. These are decided by yourself. When multiple keys are needed separate these with commas. Best practice is to use long random keys (36 chars and above), i.e. GUIDs and change these regularly
DB_DRIVER The driver to be used. One of sqlite, mysql, postgres
DB_HOST The host where the database is hosted
DB_DATABASE The name of the database to connect to
DB_USER The username for logging to the database
DB_PASS The password for logging to the database

Example .env File for MySQL

  LICENSE_NAME="Jon Doe <jon.doe@test.com>"
  LICENSE_KEY="AAA-111"
  
  APP_URL="http://localhost:32321"
  SERVER_HOST="localhost"
  SERVER_PORT="32321"
  
  API_KEYS="123,234"
  
  DB_DRIVER="mysql"
  DB_HOST="yourdbhost.com"
  DB_PORT="3306"
  DB_DATABASE="yourdatabasename"
  DB_USERNAME="yourdatabaseuser"
  DB_PASSWORD="yourdatabasepassword"
  DEBUG="yes"
      

Example .env File for SQLite

  LICENSE_NAME="Jon Doe <jon.doe@test.com>"
  LICENSE_KEY="AAA-111"
  
  APP_URL="http://localhost:32321"
  SERVER_HOST="localhost"
  SERVER_PORT="32321"
  
  API_KEYS="123,234"
  
  DB_DRIVER="sqlite"
  DB_HOST=""
  DB_PORT=""
  DB_DATABASE="./sqlite-database.db"
  DB_USERNAME=""
  DB_PASSWORD=""
  DEBUG="yes"