LoginSignup
2
2

More than 5 years have passed since last update.

herokuで静的ファイルをホスティングする

Posted at

概要

herokuの使用用途はrubyなどに限定されているので、rubyを認識する最小限のファイルを追加することによって静的ページをherokuにデプロイすることができる
Gemfileなどに'sinatra'の設定が書いてある

手順

deploy-static-files-to-heroku
# Login
$ heroku login

# Create Application (アプリ名は適当に付ける)
$ heroku create static-app-name

# Clone ruby config files
$ cd ~/repository/
$ git clone git://github.com/machida/kuroigamen-sandbox.git

# Copy ruby config files
$ cd kuroigamen-sandbox/
$ cp -r * ~/git-repository-dir/

# Add & Commit & Push
$ cd ~/git-repository-dir/
$ git add .
$ git ci -am "Add files for heroku deploy"

# Deploy to heroku
$ git push heroku master
$ cd public/

# Check
$ heroku open

http://static-app-name.herokuapp.com/ を確認する

参考

2
2
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
2