Heroku Cannot GET /

后端 未结 8 466
梦谈多话
梦谈多话 2020-12-03 21:08

I am new to Heroku and believe I am following all of the steps outlined on Heroku\'s website to deploy via node.js – https://devcenter.heroku.com/articles/getting-started-wi

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-03 21:50

    almost 3 years, but I'm answering for reference.

    • generally /dist is a build process generated directory, it's temporary and changes a lot while working in our sources, so /dist is not versioned.
    • on your package.json you can add a script called postinstall with this build process, let's say you have a task in gulp called build...so "postinstall": "gulp build"
    • if you manage your project's dependencies in bower too, npm install --save bower and "postinstall": "./node_modules/bower/bin/bower install && gulp build"

    Just a simple example croped for your package.json

    {
       "dependencies: {
        "bower":"^1.8.0",
        "grunt":"^1.0.1",
       },
       "scripts": {
        "start": "node ./www.js",
        "build": "grunt dist",
        "postinstall": "./node_modules/bower/bin/bower install && npm run build"
       }
    }
    

    Obvious you're probably done and better nowadays...I'm just referencing it for next consultings.

提交回复
热议问题