奇妙な問題があります。私は Play で書かれたアプリを持っています! フレームワーク 2.0.4。一部のパブリック アセット (css/images/javascript) を使用します。開発モードで実行すると、すべて問題ありません。
blus@vmblus:~/svn/blus> play
[info] Loading project definition from /home/blus/svn/blus/project/project
[info] Loading project definition from /home/blus/svn/blus/project
[info] Set current project to blus (in build file:/home/blus/svn/blus/)
_ _
_ __ | | __ _ _ _| |
| '_ \| |/ _' | || |_|
| __/|_|\____|\__ (_)
|_| |__/
play! 2.0.4, http://www.playframework.org
> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.
[blus] $ run
--- (Running the application from SBT, auto-reloading is enabled) ---
[info] play - Listening for HTTP on port 9000...
(Server started, use Ctrl+D to stop and go back to the console...)
アセットはブラウザに問題なく読み込まれます。しかし、同じアプリ (コピーも移動もせず、まったく同じ) を本番モードで実行したい場合、アセットはなくなります。
[blus] $ start 9000
(Starting server. Type Ctrl+D to exit logs, the server will remain in background)
Play server process ID is 6845
[info] play - Application started (Prod)
[info] play - Listening for HTTP on port 9000...
Firebug ショー:
"NetworkError: 404 Not Found - http://vmblus:9000/assets/stylesheets/main.css"
必要なすべてのアセットが見つかりません。これはどのように可能ですか?これを修正するにはどうすればよいですか?
これは私の一部ですconf/routes
:
GET /assets/*file controllers.ExternalAssets.at(path="public", file)
ビューでアセットを呼び出す方法は次のとおりです。
<link rel="stylesheet" media="screen" href="@routes.ExternalAssets.at("stylesheets/main.css")">
私はこの質問を見ましたが、私のパスにはありません//
。