September 2022
Intermediate to advanced
410 pages
10h 7m
English
To get this all to work together, Rails uses a gem called Foreman. Foreman allows you to start multiple processes together.
You specify the processes in a file called a Procfile. Rails has built one for us at Procfile.dev:
| | web: bin/rails server -p 3000 |
| | js: yarn build --watch |
| | css: yarn build:css --watch |
Each line of the Procfile is a separate process, with a label, followed by a colon, followed by the command to start the process.
We’re starting three processes:
The Rails server itself
The yarn build command we saw before, which triggers esbuild to bundle our JavaScript. This command uses the --watch parameter, so it will run in the background when a file changes.
The yarn build:css command we saw ...
Read now
Unlock full access