Amber Framework
WebsiteBlogGithubDiscord
  • Introduction
  • Getting Started
  • Guides
    • Overview
    • Installation
    • Create New App
    • Directory Structure
    • Configuration
    • Docker
    • Controllers
      • Sessions
      • Request & Response Objects
      • Halt!
      • Respond With
      • Params
      • Cookies
      • Filters
      • Flash
      • Redirection
      • CSRF
    • Views
      • Basic View Helpers
      • Form Builder
    • Models
      • Granite
        • Granite's README
        • Migrations
        • Validations
        • Callbacks
        • Associations
        • Querying
        • Bulk Insertions
      • Jennifer
        • Jennifer Docs
        • Migrations
        • Models
    • Routing
      • Pipelines
      • Routes
    • Websockets
      • Channels
      • Sockets
      • JavaScript Client
    • Mailers
    • Testing
      • System Tests
  • Deployment
    • Manual Deploy
    • Digital Ocean
    • Heroku
    • Dokku
  • CLI
    • New
    • Recipes
    • Plugins
    • Generate
    • Database
    • Watch
    • Routes
    • Exec
    • Encrypt
  • Examples
    • Amber Auth
    • Crystal Debug
    • Minimal Configuration
  • Cookbook
    • From Scratch
    • Hello World
    • CORS
    • File Download
    • File Upload
    • Cookies
    • Authenticate
    • JSON API
    • JSON Mapping
    • WebSocket Chat
  • Troubleshooting
  • In Production
  • Contributing
  • Code of Conduct
  • HAVE A QUESTION?
    • Join the Discord
    • Follow on Twitter
    • Submit an issue
Powered by GitBook
On this page
  1. CLI

Watch

The amber watch compiles and runs your project. It also monitors for changes and rebuilds when necessary.

Here is a list of the commands available:

amber watch or amber w

amber watch [OPTIONS]

Options:
  -b, --build             Overrides the default build command
                          (default: crystal build ./src/[process_name].cr)
  --build-args            Specifies arguments for the build command
  -i, --info              Shows the values for build/run commands, build/run args, and watched files
  -n, --name              Sets the name of the app process
                          (default: [process_name])
  --no-build              Skips the build step
  -r, --run               Overrides the default run command
                          (default: ./[process_name])
  --run-args              Specifies arguments for the run command
  -w, --watch (multiple)  Overrides default files and appends to list of watched files
                          (default: ./src/**/*.cr, ./src/**/*.ecr)
  -h, --help              show this help

Example

$ amber watch
02:58:23 Watcher    | (INFO) Watching 22 files (server reload)...
02:58:23 Watcher    | (INFO) Building project App01...
02:58:31 Watcher    | (INFO) Terminating app App01...
02:58:31 Watcher    | (INFO) Starting App01...
02:58:31 NodeJS     | (INFO) Installing dependencies...
02:58:31 NodeJS     | (INFO) Watching public directory
02:58:31 Server     | (INFO) Amber 0.7.2 serving application "App01" at http://0.0.0.0:3000
02:58:31 Server     | (INFO) Server started in development.
02:58:31 Server     | (INFO) Startup Time 00:00:00.000182000
02:58:31 Watcher    | Watching 10 client files...
PreviousDatabaseNextRoutes

Last updated 2 years ago