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: README.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,23 +7,36 @@ This repository is home to the code examples highlighted in various [Shopify API
7
7
#### 01 Getting Started
8
8
- Building a public Shopify application ([tutorial](https://help.shopify.com/api/tutorials/building-public-app))
9
9
10
-
#### 02 - Charging For Your App
11
-
- Billing API Tutorial ([tutorial](https://help.shopify.com/api/tutorials/adding-billing-to-your-app/))
10
+
#### 02 - Adding billing to your app
11
+
- Adding billing to your app ([tutorial](https://help.shopify.com/api/tutorials/adding-billing-to-your-app/))
12
+
13
+
## Requirements
14
+
15
+
*[Ruby](https://www.ruby-lang.org/en/documentation/installation/) (sample apps were written with Ruby 2.2.1)
16
+
*[RubyGems](https://rubygems.org/pages/download), the package management tool for Ruby
17
+
*[Bundler for Ruby](http://bundler.io/), a dependency manager
18
+
19
+
## Installation
20
+
21
+
* Download the sample code from the [this repo](https://github.com/Shopify/example-ruby-app)
22
+
* To get the necessary dependencies, navigate to the application folder and type `bundle install`
12
23
13
24
## Credentials
14
25
15
-
This example uses a `.env` file to store the application credentials. After cloning the repository, you'll need to create a file named `.env` in the same folder of the tutorial. The contents of the file should be as follows:
26
+
To create a public app and retrieve your API credentials, sign up for a [Shopify Partners account](https://app.shopify.com/services/partners/auth/login) and [follow this guide](https://help.shopify.com/api/guides/api-credentials).
27
+
28
+
This tutorial series uses a `.env` file to store application credentials. For each installment in the series there is a corresponding app directory and `app.rb` file. When following the tutorials, make sure the app directory includes a `.env` file with contents as follows:
16
29
```
17
30
API_KEY=YOUR_API_KEY
18
31
API_SECRET=YOUR_SECRET_KEY
19
32
```
20
33
21
34
where `YOUR_API_KEY` and `YOUR_SECRET_KEY` are the values of your application's API key and secret key respectively.
22
35
23
-
To retrieve your API credentials, sign up for a [Shopify Partners account](https://app.shopify.com/services/partners/auth/login) and [follow this guide](/api/introduction/getting-started).
36
+
## App URL
37
+
38
+
This tutorial series using [ngrok](https://ngrok.com/) to create a secure tunnel from the public Internet to your local machine. For each installment in the series, you will need to copy the `APP_URL` generated by ngrok to your `app.rb` file. Additionally, the `APP_URL` needs to be added to the **App URLs** section of your public app settings. These procedures are covered in part one of the tutorials.
24
39
25
-
## Running the app
40
+
## Running the apps
26
41
27
-
1. Create the `.env` file as described above.
28
-
2.`bundle install` to obtain all of the necessary dependencies
29
-
3.`ruby app.rb` to run the example application.
42
+
Each installment of the tutorials includes an app.rb file inside the app directory. To initialize an app, navigate to the correct app directory in terminal and then run `ruby app.rb`.
0 commit comments