- Heroku Cloud Application Development
- Anubhav Hanjura
- 243字
- 2021-08-20 17:55:05
Running applications locally
How often have we faced issues in the production environment that fail to reproduce in the development environment? Hence, it is critical that when developing and debugging an application, the code in a local development environment is executed in the same manner as the remote environment. This ensures that any differences between the two environments and bugs that hard to find are intercepted before deploying the code to production.
In a local development environment, you can run a small-scale version of your application by launching one process for each of the two process types: web and worker.
Foreman is a command-line tool used to run Procfile-based applications locally. It is installed automatically by the Heroku toolbelt (Heroku client package), and is also available as a gem.
If you don't have foreman installed, use the gem install foreman
command to install it from the prompt.
Starting foreman is easy as shown in the following screenshot:

Since the Procfile has both web and worker processes, foreman will start one of each process type with the output interleaved on your terminal. Your web process uses port 5000, because this is what foreman provides as a default in the $PORT environment variable. The web process must use this value, since it is used by the Heroku platform on deployment as well. You can test the application now. Press Ctrl + C to send a signal to close down the application when it is done.
- vSphere Virtual Machine Management
- VMware Horizon View 6 Desktop Virtualization Cookbook
- 高性能Linux服務器構建實戰:運維監控、性能調優與集群應用
- 構建可擴展分布式系統:方法與實踐
- 計算機系統開發與優化實戰
- Linux自動化運維:Shell與Ansible(微課版)
- Linux內核觀測技術BPF
- Linux內核設計的藝術:圖解Linux操作系統架構設計與實現原理
- 計算機系統:基于x86+Linux平臺
- 云原生落地:產品、架構與商業模式
- Hands-On GPU Programming with Python and CUDA
- 大學計算機應用基礎實踐教程(Windows 7+MS Office 2010)
- Web Penetration Testing with Kali Linux(Third Edition)
- Raspberry Pi入門指南
- 每天5分鐘玩轉Docker容器技術