kantaroso / game-information

0 stars 0 forks source link

バックエンド側のproduction環境を用意する #13

Closed kantaroso closed 3 years ago

kantaroso commented 3 years ago

以下の理由から ibmクラウド でやってみる

kantaroso commented 3 years ago

データベース:Db2

https://qiita.com/Asuka_Saito/items/c40a17f02a588953f576

アプリケーション:cf

https://qiita.com/n0bisuke/items/4c29aad3696edcc627f2

kantaroso commented 3 years ago

cf にお試しで下記をdeploy

$ curl http://gameinfomation.us-south.cf.appdomain.cloud/
Hello, World
内容メモ * 一覧 ```shell $ tree . ├── go.mod ├── go.sum ├── main ├── main.go └── manifest.yml ``` * `main.go` ```go package main import ( "os" "github.com/gin-gonic/gin" ) func main() { r := gin.Default() r.GET("/", func(c *gin.Context) { c.String(200, "Hello, World") }) r.GET("/health", func(c *gin.Context) { c.String(200, "OK") }) port := os.Getenv("PORT") if port == "" { port = "8080" //Local } r.Run(":" + port) } ``` * `manifest.yml` ```yml applications: - name: gameinfomation random-route: true memory: 64M env: GOVERSION: go1.14 ```
kantaroso commented 3 years ago

db2で作り直しするの面倒なのでdbを使わずに公開できるような形に修正する

https://github.com/kantaroso/game-information/issues/14 https://github.com/kantaroso/game-information/issues/15

kantaroso commented 3 years ago

ok

https://bizyoge.web.app/