LoginSignup
2
1

More than 5 years have passed since last update.

Playプロジェクトにプロジェクト名を与える

Last updated at Posted at 2016-07-14

何もしないままだとhttp://localhost:9000/でアクセスすることができますが,このままだとどのプロジェクトがわかりづらいので,今回はこのURLをhttp://localhost:9000/プロジェクト名/にする方法を紹介します.

プロジェクト名をSampleProjectとします.

設定

conf/application.conf

play.crypto.secret = "changeme"

# The application languages
# ~~~~~
play.i18n.langs = [ "en" ]

## 以下を追加
application.context = /SampleProject/

conf/routesファイルは何も手を加えなくて結構です.

これでhttp://localhost:9000/SampleProject/にアクセスするとPlayの画面が表示されるようになります.

付録

warファイル化するときとかこの設定をしておかないと,すでに動いているプロジェクトと衝突してしまう可能性があります.

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