Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I deploy an Angular.js app?

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" error. Any thoughts?

UPDATE

I'm trying to serve this to heorku as a Node.js application, but still can't seem to get it working. There's a web-server.js file in the root directory of my application and I reference it in my Procfile here:

web: node web-server.js

And here's my package.json file, also in the root directory:

{
"name": "medicare-data",
"version": "0.0.1",
"dependencies": {
},
"engines": {
    "node": "0.10.x",
    "npm": "1.2.x"
},
"respository": "medicare-data",
"author": "sararob"
}

I'm getting a "slug compilation error" in my heroku logs. Thoughts on why this might not be working?

like image 269
Sara Avatar asked May 21 '13 15:05

Sara


People also ask

How is AngularJS deployed?

The developer develops Web app and deploys them for execution on the Browser, so that the client can browse it. An application developed by using JavaScript, AngularJS, BootStrap, NodeJs is very easy to deploy.

What is the best server to deploy Angular app?

Firebase hosting is the best hosting to use to deploy your angular app or react app.


1 Answers

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
like image 147
Sam McAfee Avatar answered Sep 28 '22 09:09

Sam McAfee