Heroku
//登入heroku
heroku login
//下載應用程式
git clone https://github.com/heroku/java-getting-started
//建立Heroku
heroku create
//部署代碼至Heroku
git push heroku master
//設定正在運行的dynos數量
heroku ps:scale web=<數量> queue=<數量>
//查看日誌
heroku logs --tail
//檢查正在運行的dynos數量、內容
heroku ps
//打開網站
heroku open
//本地運行應用程式 (http://localhost:5000)
heroku local
//設置config環境變數
heroku config:set <變數>="<值>"
//查看config
heroku config
//查看發布紀錄
heroku releases
//在 heroku 上執行指令
heroku run
//下載插件
heroku addons:create {name}
//列出現在有數據庫
heroku addons
//查看插件的日誌消息
heroku addons:open {name}
//查看Heroku Postgres信息
heroku pg
heroku logs -n 500 -a ilearned-https //找ilearned-https這個專案前500筆Log檔
Heroku應用程序使用一個名為Procfile的特殊明文文件來明確聲明應該執行哪個命令來啟動您的應用程序
程式碼為:
web: java -jar target/java-getting-started-1.0.jar
這段是一個進程類型,web以及運行它所需的命令,其中的web
聲明此進程類型將附加到Heroku的HTTP路由,並且它將能夠接收Web流量
表示要使用的Java版本
java.runtime.version=1.8
一、建立檔案 .gitignore //不上傳檔案 二、指令 git --version //檢查版本 git init //初始化git git add [--all] //加入檔案 git add -f [filename] //強制加入檔案 git commit -m "mag" //建立儲存檔 git config user.name "name" //使用者名稱
Feb 22, 2021SQL MongoDB 說明 database database 資料庫 table collection
Oct 7, 2020專案架構 com.zygroup.ilnd config CustomerConfig 第一個資料庫Config ProductConfig 第二個資料庫Config model 第一個資料表
Oct 5, 2020/pom.xml <!-- https://github.com/google/guava --> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>28.1-jre</version> </dependency> Guava is a set of core Java libraries from Google that includes new collection types (such as multimap and multiset), immutable collections, a graph library, and utilities for concurrency, I/O, hashing, caching, primitives, strings, and more! It is widely used on most Java projects within Google, and widely used by many other companies as well. https://github.com/google/guava
Mar 5, 2020or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up