简体   繁体   English

在heroku中部署hapi.js应用

[英]Deploying hapi.js app in heroku

I'm currently trying to deploy a hapi.js app to heroku with this file structure: 我目前正在尝试使用此文件结构将hapi.js应用程序部署到heroku:

  • .git .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. hapi.js服务器及其package.json文件,node_modules以及所有其他东西都位于服务器文件夹中。 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). 在client文件夹中,我拥有所有与前端相关的内容(带有bower_components的小角度应用程序和用于注入所有内容的gulp脚本)。 The server.js from /server is serving both the bower_components and the angular app related files. 来自/ server的server.js同时提供bower_components和与angular app相关的文件。

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). 我当前的问题是,显然,Heroku由于其结构而找不到部署我的应用程序的方法,因为它需要在项目的根目录上具有server和package.json(我试图避免这种情况)所有费用)。

So far I tried to put on my Procfile the following: 到目前为止,我尝试将以下内容放在Procfile中:

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文件

.bowerrc file contains .bowerrc文件包含

{
  "directory": "client/bower_components"
}

and add bower.json in root. 并在根目录中添加bower.json。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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