I'm trying to deploy my Play!Framework to Heroku but I'm having the following errors:
app[web.1]: [error] application - Error reading filename: create_user.json
app[web.1]: [error] application - Error reading filename: delete_user.json
app[web.1]: [error] application - Error reading filename: login_user.json
...
I use these .json file as schema to validate the inputs from the client. They are located under the 'app/assets/json/' directory. I guess they aren't being pushed to Heroku at all, but I don't know how to check that either.
I saw similar issues where the missing files are located under 'public' directory, so that a 'git add -A' would solve the problem:
Scala Play 2.1.0 - Assets not appearing on Heroku?
However, it does not apply to my problem.
Additional info: Play 2.2.2, MongoHQ, server-side only.
Thank in advance!
Edit:
The stacktrace shows me that the application is looking for the json files at
/app/target/universal/stage/app/assets/json/
where /app corresponds to the default root of the application in the Heroku dyno (checked with 'heroku run bash'), /target/universal/stage is defined in my Procfile, and the remaining path /app/assets/json is the correct hierarchy in my development environment. The path above doesn't exist on Heroku, obviously.
I'm using the following method to get the json files:
Play.application().getFile("app/assets/json/create_user.json");
Works in development environment, but not in production. I don't know how to make these files accessible in production as well.