LoginSignup
2
1

More than 5 years have passed since last update.

Server Side Swiftで作ったアプリケーションをHerokuにデプロイ #love_swift

Posted at

Swiftサーバーサイド入門 Vaporの紹介の手順が参考になりました。

Herokuコマンド

$ wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh

参考: https://qiita.com/ryotaro76/items/6aa9d3187d742eed0325

インストールが完了したら、Herokuのアカウントでログインします。

$ heroku login

Procfile作成

今回はSwiftのプロジェクトとしては、webappというプロジェクト名です。

web: webapp --port=$PORT

Herokuでアプリケーション作成

lineswiftappというアプリケーションをHeroku上で作成しました。

(Swiftのプロジェクト名と合わせてwebappと名付けたかったのですが、ネームスペース的に無理でした。)

デプロイ

$ heroku buildpacks:set https://github.com/kylef/heroku-buildpack-swift.git --app lineswiftapp
Buildpack set. Next release on lineswiftapp will use https://github.com/kylef/heroku-buildpack-swift.git.
Run git push heroku master to create a new release using this buildpack.
  • git pushする
$ git init
$ git add -A
$ git commit -m 'init'
$ heroku git:remote -a lineswiftapp
$ git push heroku master

これでデプロイがスタートします。

エラーが出なければ成功です。

LINE BOTのエンドポイントに

sslが利用できるので前回作ったLINE BOTもホスティングできます。

ssl対応が地味にめんどくさいですからね。笑

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1