Skip to content

Commit 9983640

Browse files
committed
docs (generators): Heroku generator run manually
Remove 'yo angular-fullstack:heroku' (not working) Update docs to reflect manual setup Fixes: angular-fullstack#1966, angular-fullstack#1950
1 parent c262211 commit 9983640

File tree

1 file changed

+37
-9
lines changed

1 file changed

+37
-9
lines changed

Diff for: docs/generators/heroku.md

+37-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,52 @@
11
### Heroku
22

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:
45

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:
519
```
6-
yo angular-fullstack:heroku
20+
heroku addons:create mongolab
21+
```
22+
23+
Now, build your app by running:
24+
```
25+
gulp build
726
```
27+
This creates a folder called ###dist .
828

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+
```
1033

34+
Now, add Heroku as your ###dist folder's remote repository:
35+
```
36+
heroku git:remote -a myapp
37+
```
1138

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+
```
1343

44+
To view your app run:
1445
```
15-
heroku addons:create mongolab
46+
heroku open
1647
```
1748

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:
1950
```
2051
options: {
2152
db: {
@@ -27,9 +58,6 @@ options: {
2758
```
2859
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.
2960

30-
31-
Your app should now be live. To view it run `heroku open`.
32-
3361
>
3462
> 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 :
3563
>

0 commit comments

Comments
 (0)