You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/generators/heroku.md
+37-9
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,52 @@
1
1
### Heroku
2
2
3
-
Deploying to heroku only takes a few steps.
3
+
#### Setup
4
+
In order to deploy to Heroku, first you need to take these steps:
4
5
6
+
Create a [Heroku](www.heroku.com) account.
7
+
Install the [Heroku Toolbelt](https://devcenter.heroku.com/articles/getting-started-with-nodejs#set-up)
8
+
9
+
heroku login (if you are not already authenticated).
10
+
11
+
Create an app on Heroku and giving it a name (e.g. myapp):
12
+
```
13
+
heroku apps:create myapp
14
+
```
15
+
You can also use Heroku dashboard to create an app.
16
+
17
+
If you're using mongoDB you will need to add a database to your app (e.g. [mlab](https://mlab.com/) or [compose](https://www.compose.com/mongodb)):
18
+
Here we use mlab:
5
19
```
6
-
yo angular-fullstack:heroku
20
+
heroku addons:create mongolab
21
+
```
22
+
23
+
Now, build your app by running:
24
+
```
25
+
gulp build
7
26
```
27
+
This creates a folder called ###dist .
8
28
9
-
To work with your new heroku app using the command line, you will need to run any `heroku` commands from the `dist` folder.
29
+
Now go to ###dist and set it up as a git repository:
30
+
```
31
+
git init
32
+
```
10
33
34
+
Now, add Heroku as your ###dist folder's remote repository:
35
+
```
36
+
heroku git:remote -a myapp
37
+
```
11
38
12
-
If you're using mongoDB you will need to add a database to your app:
39
+
Now, it is time to push your local repository(###dist) to Heroku. From your app's root run:
40
+
```
41
+
gulp buildcontrol:heroku
42
+
```
13
43
44
+
To view your app run:
14
45
```
15
-
heroku addons:create mongolab
46
+
heroku open
16
47
```
17
48
18
-
Note: if you get an `Error: No valid replicaset instance servers found` you need to modify moongose connection options in config/environment/production.js as follows:
49
+
Note on MongoDB setup: if you get an `Error: No valid replicaset instance servers found` you need to modify moongose connection options in config/environment/production.js as follows:
19
50
```
20
51
options: {
21
52
db: {
@@ -27,9 +58,6 @@ options: {
27
58
```
28
59
One of the odd things about the Node driver is that the default timeout for replica set connections is only 1 second, so make sure you're setting it to something more like 30s like in this example.
29
60
30
-
31
-
Your app should now be live. To view it run `heroku open`.
32
-
33
61
>
34
62
> If you're using any oAuth strategies, you must set environment variables for your selected oAuth. For example, if we're using **Facebook** oAuth we would do this :
0 commit comments