简体   繁体   中英

Deploying hapi.js app in heroku

I'm currently trying to deploy a hapi.js app to heroku with this file structure:

  • .git
  • client
  • server

The hapi.js server is inside the server folder along with it's package.json file, node_modules and all that stuff. Inside the client folder, I have all the front-end related things (small angular app with bower_components and a gulp script to inject everything). The server.js from /server is serving both the bower_components and the angular app related files.

My current problem is that, obviously, Heroku doesn't find a way to deploy my app because of its structure, since it needs to have the server and package.json on the root of the project (which i'm trying to avoid at all costs).

So far I tried to put on my Procfile the following:

web: node server/server.js

but unfortunately it didn't let me push because it didn't match any of its buildpacks.

Have you add .bowerrc file

.bowerrc file contains

{
  "directory": "client/bower_components"
}

and add bower.json in root.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM