Skip to content

Commit

Permalink
edit readme
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianodelgado committed Sep 21, 2020
1 parent 4f9bc3e commit 625abeb
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 1 deletion.
Binary file added .readme-static/create-a-new-app-in-heroku-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .readme-static/create-a-new-app-in-heroku-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .readme-static/create-a-new-app-in-heroku-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .readme-static/create-a-new-app-in-heroku-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .readme-static/create-a-new-app-in-heroku-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 85 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,91 @@ This documentation can be enabled or disabled from the [configuration](#configur
<a name="deploy-in-heroku"></a>
## 🖥️ Deploy server in heroku (free)

https://signup.heroku.com/
You can run the bot server in a productive environment on any node server, in this case I will explain the steps to raise the server on the platform [Heroku](https://heroku.com/), which has a free version to deploy node servers, you can also hire a paid service which gives you more features.

> 💬 If you don't have a Heroku account, you can create one by going to [https://signup.heroku.com/](https://signup.heroku.com/).
We will need a file called `Procfile`, which is the one Heroku will use to initialize the server once deployed.

Its content is:
```
web: npm start
```

1. After logging into Heroku, click on Create new app

<p align="center">
<img style='width: 100%' alt="Create a new app in heroku 1" src="./.readme-static/create-a-new-app-in-heroku-1.png" />
</p>

2. We write the name of our app, and select a region, and then click on Create App.
> 💬 note: Remember to save the name of the app, as you will need it later to replace the value of <app_name> with the name of the app.
<p align="center">
<img style='width: 100%' alt="Create a new app in heroku 2" src="./.readme-static/create-a-new-app-in-heroku-2.png" />
</p>

3. Heroku gives you several options to deploy your server. You can do it with [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) by following the steps in the documentation, or you can deploy it directly from Github, which is much easier.

<p align="center">
<img style='width: 100%' alt="Create a new app in heroku 3" src="./.readme-static/create-a-new-app-in-heroku-3.png" />
</p>

#### Deployment method: Heroku CLI

Download and install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli).

If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key.

```
heroku login
```

##### Create a new Git repository
Initialize a git repository in a new or existing directory
```
cd my-project/
git init
heroku git:remote -a <app_name>
```
##### Deploy your application
Commit your code to the repository and deploy it to Heroku using Git.
```
git add .
git commit -am "make it better"
git push heroku master
```

##### Deploy your application
For existing repositories, simply add the heroku remote
```
heroku git:remote -a <app_name>
```

#### Deployment method: GitHub
We click on the connect to GitHub button, if you've never connected Heroku to Github, a window will open to authorize the connection so you can continue with the step of entering the name of the repository and searching it in your GitHub account, and once you find it, we click on the Connect button.

<p align="center">
<img style='width: 100%' alt="Create a new app in heroku 4" src="./.readme-static/create-a-new-app-in-heroku-4.png" />
</p>

Then we select the branch we want to deploy, and click on Deploy Branch, and it will start running the deployment, downloading the code from the repository, installing the dependencies, etc.

<p align="center">
<img style='width: 100%' alt="Create a new app in heroku 5" src="./.readme-static/create-a-new-app-in-heroku-5.png" />
</p>

4. Now we have to configure the environment variables of the server, although we can do it manually from **Settings > Config Vars**, there is a bash script prepared that will raise the environment variables of our `.env` file that is located in the `./variables` folder.
```
npm run heroku:envs
```
or
```
bash heroku-envs.sh
```
<p align="center">
<img style='width: 100%' alt="Create a new app in heroku 6" src="./.readme-static/create-a-new-app-in-heroku-6.png" />
</p>

<a name="setup-the-facebook-app"></a>

Expand Down

0 comments on commit 625abeb

Please sign in to comment.