How do I deploy an Angular.js app?

后端 未结 3 1936
青春惊慌失措
青春惊慌失措 2021-02-05 12:38

This may be a stupid question, but I\'m wondering what platform I should use to deploy my Angular.js app? I tried using Heroku but got a \"no Cedar-supported app detected\" erro

3条回答
  •  别跟我提以往
    2021-02-05 13:10

    You can run an Angular app on heroku if it is served as a node.js application. Usually, when you start working with Angular seed, there is already a node webserver script in the project. I believe if there is a package.json file in the root, heroku will detect and run it as a node.js application. I'll come back and update this answer with more detail shortly.

    UPDATE

    From the Heroku docs (and I am no expert), it has this passage after the deploy section: https://devcenter.heroku.com/articles/nodejs#visit-your-application

    which basically tells you to make sure you have one dyno running. You can do that either through the web app under the settings of your app or you can run this:

    $ heroku ps:scale web=1
    

    To see if the process is running, do

    $ heroku ps
    === web: `node web.js`
    web.1: up for 10s
    

提交回复
热议问题