LogoLogo
HomeAPIBlog
3.0.0-SNAPSHOT
3.0.0-SNAPSHOT
  • INTRODUCTION
    • Getting Started
      • Running Local Development Servers
      • Beginner Tutorial: Hello World
      • Beginner Tutorial: Hello Database
      • Tutorial: Wheels, AJAX, and You
    • Frameworks and Wheels
    • Requirements
    • Manual Installation
    • Upgrading
    • Screencasts
  • Command Line Tools
    • CLI Overview
    • Quick Start Guide
    • Command Reference
      • Core Commands
        • wheels init
        • wheels info
        • wheels reload
        • wheels deps
        • wheels destroy
        • wheels watch
      • Code Generation
        • wheels generate app
        • wheels generate app-wizard
        • wheels generate controller
        • wheels generate model
        • wheels generate view
        • wheels generate property
        • wheels generate route
        • wheels generate resource
        • wheels generate api-resource
        • wheels generate frontend
        • wheels generate test
        • wheels generate snippets
        • wheels scaffold
      • Database Commands
        • wheels dbmigrate info
        • wheels dbmigrate latest
        • wheels dbmigrate up
        • wheels dbmigrate down
        • wheels dbmigrate reset
        • wheels dbmigrate exec
        • wheels dbmigrate create blank
        • wheels dbmigrate create table
        • wheels dbmigrate create column
        • wheels dbmigrate remove table
        • wheels db schema
        • wheels db seed
      • Testing Commands
        • wheels test
        • wheels test run
        • wheels test coverage
        • wheels test debug
      • Configuration Commands
        • wheels config list
        • wheels config set
        • wheels config env
      • Environment Management
        • wheels env
        • wheels env setup
        • wheels env list
        • wheels env switch
      • Plugin Management
        • wheels plugins
        • wheels plugins list
        • wheels plugins install
        • wheels plugins remove
      • Code Analysis
        • wheels analyze
        • wheels analyze code
        • wheels analyze performance
        • wheels analyze security
      • Security Commands
        • wheels security
        • wheels security scan
      • Performance Commands
        • wheels optimize
        • wheels optimize performance
      • Documentation Commands
        • wheels docs
        • wheels docs generate
        • wheels docs serve
      • CI/CD Commands
        • wheels ci init
      • Docker Commands
        • wheels docker init
        • wheels docker deploy
      • Deployment Commands
        • wheels deploy
        • wheels deploy audit
        • wheels deploy exec
        • wheels deploy hooks
        • wheels deploy init
        • wheels deploy lock
        • wheels deploy logs
        • wheels deploy proxy
        • wheels deploy push
        • wheels deploy rollback
        • wheels deploy secrets
        • wheels deploy setup
        • wheels deploy status
        • wheels deploy stop
    • CLI Development Guides
      • Creating Commands
      • Service Architecture
      • Migrations Guide
      • Testing Guide
  • Working with Wheels
    • Conventions
    • Configuration and Defaults
    • Directory Structure
    • Switching Environments
    • Testing Your Application
    • Using the Test Environment
    • Contributing to Wheels
    • Submitting Pull Requests
    • Documenting your Code
  • Handling Requests with Controllers
    • Request Handling
    • Rendering Content
    • Redirecting Users
    • Sending Files
    • Sending Email
    • Responding with Multiple Formats
    • Using the Flash
    • Using Filters
    • Verification
    • Event Handlers
    • Routing
    • URL Rewriting
      • Apache
      • IIS
      • Tomcat
      • Nginx
    • Obfuscating URLs
    • Caching
    • Nesting Controllers
    • CORS Requests
  • Displaying Views to Users
    • Pages
    • Partials
    • Linking Pages
    • Layouts
    • Form Helpers and Showing Errors
    • Displaying Links for Pagination
    • Date, Media, and Text Helpers
    • Creating Custom View Helpers
    • Localization
  • Database Interaction Through Models
    • Object Relational Mapping
    • Creating Records
    • Reading Records
    • Updating Records
    • Deleting Records
    • Column Statistics
    • Dynamic Finders
    • Getting Paginated Data
    • Associations
    • Nested Properties
    • Object Validation
    • Object Callbacks
    • Calculated Properties
    • Transactions
    • Dirty Records
    • Soft Delete
    • Automatic Time Stamps
    • Database Migrations
      • Migrations in Production
    • Using Multiple Data Sources
  • Plugins
    • Installing and Using Plugins
    • Developing Plugins
    • Publishing Plugins
  • Project Documentation
    • Overview
  • External Links
    • Source Code
    • Issue Tracker
    • Sponsor Us
    • Community
Powered by GitBook
LogoLogo
On this page
  • Usage
  • Parameters
  • Description
  • Examples
  • Basic documentation server
  • Serve on different port
  • Open in browser automatically
  • Serve without watching for changes
  • Bind to all interfaces
  • Server Output
  • Features
  • Live Reload
  • Search Functionality
  • Navigation
  • Print Support
  • Development Workflow
  • Typical usage during development:
  • Review workflow:
  • Configuration
  • Server Configuration
  • Custom Headers
  • Access Control
  • Basic Authentication
  • IP Restrictions
  • Troubleshooting
  • Common Issues
  • Notes

Was this helpful?

Edit on GitHub
Export as PDF
  1. Command Line Tools
  2. Command Reference
  3. Documentation Commands

wheels docs serve

Serves generated documentation locally with live reload for development and review.

Usage

wheels docs serve [--port=<port>] [--host=<host>] [--open] [--watch]

Parameters

  • --port - (Optional) Port number to serve on. Default: 4000

  • --host - (Optional) Host to bind to. Default: localhost

  • --open - (Optional) Open browser automatically after starting

  • --watch - (Optional) Watch for changes and regenerate. Default: true

Description

The docs serve command starts a local web server to preview your generated documentation. It includes:

  • Live reload on documentation changes

  • Search functionality

  • Responsive design preview

  • Print-friendly styling

  • Offline access support

Examples

Basic documentation server

wheels docs serve

Serve on different port

wheels docs serve --port=8080

Open in browser automatically

wheels docs serve --open

Serve without watching for changes

wheels docs serve --no-watch

Bind to all interfaces

wheels docs serve --host=0.0.0.0

Server Output

Starting documentation server...
================================

Configuration:
- Documentation path: /docs/generated/
- Server URL: http://localhost:4000
- Live reload: enabled
- File watching: enabled

Server started successfully!
- Local: http://localhost:4000
- Network: http://192.168.1.100:4000

Press Ctrl+C to stop the server

[2024-01-15 14:30:22] Serving documentation...
[2024-01-15 14:30:45] GET / - 200 OK (15ms)
[2024-01-15 14:30:46] GET /models/user.html - 200 OK (8ms)
[2024-01-15 14:31:02] File changed: /app/models/User.cfc
[2024-01-15 14:31:02] Regenerating documentation...
[2024-01-15 14:31:05] Documentation updated - reloading browsers

Features

Live Reload

When --watch is enabled, the server:

  • Monitors source files for changes

  • Automatically regenerates affected documentation

  • Refreshes browser without manual reload

Search Functionality

  • Full-text search across all documentation

  • Instant results as you type

  • Keyboard navigation (Ctrl+K or Cmd+K)

  • Search history

Navigation

Documentation Structure:
/                     # Home page with overview
/models/              # All models documentation
/models/user.html     # Specific model docs
/controllers/         # Controller documentation  
/api/                 # API reference
/guides/              # Custom guides
/search               # Search page

Print Support

  • Optimized CSS for printing

  • Clean layout without navigation

  • Page breaks at logical points

  • Print entire docs or single pages

Development Workflow

Typical usage during development:

# Terminal 1: Start the docs server
wheels docs serve --open

# Terminal 2: Make code changes
# Edit your models/controllers
# Documentation auto-updates

# Terminal 3: Generate fresh docs if needed
wheels docs generate

Review workflow:

# Generate and serve for team review
wheels docs generate --format=html
wheels docs serve --port=3000 --host=0.0.0.0

# Share URL with team
echo "Documentation available at http://$(hostname -I | awk '{print $1}'):3000"

Configuration

Server Configuration

Create /config/docs-server.json:

{
  "server": {
    "port": 4000,
    "host": "localhost",
    "baseUrl": "/docs",
    "cors": true
  },
  "watch": {
    "enabled": true,
    "paths": ["app/", "config/"],
    "ignore": ["*.log", "temp/"],
    "delay": 1000
  },
  "features": {
    "search": true,
    "print": true,
    "offline": true,
    "analytics": false
  }
}

Custom Headers

{
  "headers": {
    "Cache-Control": "no-cache",
    "X-Frame-Options": "SAMEORIGIN",
    "Content-Security-Policy": "default-src 'self'"
  }
}

Access Control

Basic Authentication

wheels docs serve --auth=username:password

IP Restrictions

wheels docs serve --allow="192.168.1.0/24,10.0.0.0/8"

Troubleshooting

Common Issues

Port already in use:

Error: Port 4000 is already in use

# Solution: Use a different port
wheels docs serve --port=4001

Cannot access from network:

# Bind to all interfaces
wheels docs serve --host=0.0.0.0

# Check firewall settings

Documentation not updating:

# Force regeneration
wheels docs generate --force
wheels docs serve --watch

Notes

  • Server is intended for development/review only

  • For production, deploy static files to web server

  • Large documentation sets may take time to generate

  • Browser must support JavaScript for search

  • Offline mode caches documentation locally

Previouswheels docs generateNextCI/CD Commands

Last updated 2 days ago

Was this helpful?