2014-06-18 2 views
0

나는 Heroku에서 나의 브런치 빌드를 얻으려고했다. 내 익스프레스 위로 이동하면 사이트로 이동할 때 Cannot GET /이 표시됩니다. 로그에서 브런치 + Heroku 빌드`Can not GET/'

밀어

:

 > [email protected] postinstall /tmp/build_13daabc0-9174-41fd-a59e-c2a894c07256 
     > ./node_modules/brunch/bin/brunch build --production 

     18 Jun 08:59:09 - info: compiled 21 files into 3 files, copied 23 in 5200ms 
-----> Caching node_modules directory for future builds 
-----> Cleaning up node-gyp and npm artifacts 
-----> Building runtime environment 
-----> Discovering process types 
     Procfile declares types -> web 

-----> Compressing... done, 11.8MB 
-----> Launching... done, v7 
     http://nameless-fortress-7923.herokuapp.com/ deployed to Heroku 

To [email protected]:nameless-fortress-7923.git 
+ 75f1076...9d2a80b master -> master (forced update) 

package.json 종속성 :

"dependencies": { 
    "express": "^4.4.3", 
    "passport-http": "^0.2.2", 
    "passport": "^0.2.0", 
    "brunch": "^1.7.14", 
    "javascript-brunch": "^1.7.1", 
    "coffee-script-brunch": "^1.7.3", 
    "css-brunch": "^1.7.0", 
    "stylus-brunch": "^1.7.0", 
    "static-jade-brunch": "^1.7.0", 
    "jade-brunch": "^1.5.1", 
    "uglify-js-brunch": "^1.7.7", 
    "clean-css-brunch": "^1.7.1" 
    }, 

내 Express는 단순히 (일부 인증 뒤에) public/를 제공, this처럼 보이는.

성공적으로 빌드되지만, public/ 폴더가 Heroku에 의해 제거/지워진 것처럼 보입니까?

왜 이런 일이 발생하는지 알고 싶습니다.

답변

0

정말 좋은 해결책은 아니지만 제 해결 방법은 단순히 로컬에서 컴파일하여 git에 추가하는 것입니다.

나는 내`package.json`에서`postinstall` 스크립트가이

default: run 

run: 
    rm -rf public 
    ./node_modules/brunch/bin/brunch w -s 

deploy: 
    rm -rf public/ 
    rm -rf build/ 
    ./node_modules/brunch/bin/brunch build --production 
    mv public/ build/ 
    git add --all build/ 
    git commit -m "heroku deploy" 
    git push heroku master --force 
    git reset HEAD~1 
    rm -rf build/ 
    heroku open 
0

나는 Brunch를 사용한 적이 없지만 다른 빌드 도구를 사용하면 빌드 중에 dist 폴더를 만듭니다. 해당 dist 폴더가 gitignore에 포함되어 있으면 Heroku에 푸시되지 않습니다.

공용 폴더에서 동일한 문제가 발생할 수 있습니다.

+0

처럼 보이는, 내 Makefiledeploy 명령을했다 :' "스크립트": { "사후을": "./node_modules/brunch/bin/brunch 빌드 - 제작 " }' – Alex