Brunch + Heroku build `Cannot GET /`
Brunch + Heroku build `Cannot GET /`
我已经设法在Heroku上建立了我的Brunch。然而,我的Express up在导航到站点时显示Cannot GET /
。
从日志中推送:
> preso@1.0.0 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 git@heroku.com:nameless-fortress-7923.git
+ 75f1076...9d2a80b master -> master (forced update)
包。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"
},
My Express简单地提供public/
(在一些认证之后),看起来像这样。
它得到构建成功,但似乎public/
文件夹被Heroku删除/清除?
任何关于为什么会发生这种情况的想法将是感激的。
我从未使用过Brunch,但与其他构建工具一起,它会在构建期间创建一个dist文件夹。如果该dist文件夹包含在gitignore中,它不会被推送到Heroku。
同样的事情可能发生在你的公用文件夹
并不是一个很好的解决方案,但我的解决方法是简单地在本地编译它并将其添加到git中。
我在我的Makefile
中做了一个deploy
命令,看起来像这样
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
相关文章:
- 有没有一种方法可以防止img get请求使用css或js发生
- CORS-重定向到第二个GET正在接收的页面
- jQuery Ajax GET请求工作不正常
- 如何将PHP get查询转换为Meteor's HTTP.get()
- 返回/从Twit's客户端.get
- AngularJS错误:提供程序必须从$get工厂方法返回值
- 如何在router.get()方法中传递url作为参数
- 使用Javascript/JQuery获取JSON GET数据
- 如何使用php文件中的GET来获取我在.js文件中声明的变量
- Get方法获取csv文件的内容
- 快速服务器在试图访问index.html时返回Cannot Get
- Vue 2和Vue- resource [Cannot read property 'get'未定义的(
- express js cannot GET /page
- React 'Cannot GET /'
- Brunch + Heroku build `Cannot GET /`
- 对存储的响应出错.get: TypeError: Cannot read property 'style'
- $http TypeError: Cannot read property 'get'未定义的——在工厂
- 未捕获的TypeError: Cannot read property 'get'的定义
- Angular2 - Cannot GET /
- get "Cannot set property 'src'null"但是这个元素是