10000 revise readme · n00bdevel/example-ruby-app@5662409 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5662409

Browse files
committed
revise readme
1 parent fd31af6 commit 5662409

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

02 Charging For Your App/app.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def initialize
5050
get '/activatecharge' do
5151
# store the charge_id from the request
5252
recurring_application_charge = ShopifyAPI::RecurringApplicationCharge.find(request.params['charge_id'])
53-
recurring_application_charge.status == "accepted" ? recurring_application_charge.activate : redirect bulk_edit_url
53+
recurring_application_charge.status == "accepted" ? recurring_application_charge.activate : redirect(bulk_edit_url)
5454

5555
# once the charge is activated, subscribe to the order/create webhook and redirect the user back to the bulk edit URL
5656
create_order_webhook

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Shopify App Examples
22

3-
This repository is home to the code examples highlighted in various [Shopify API tutorials](http://docs.myshopify.io/api/tutorials/). They are designed solely for the purposes of introducing new developers to the Shopify API. This apps are written in [Sinatra](https://github.com/sinatra/sinatra), but the concepts presented will also apply to developers building applications in other languages such as Python, Node.js and PHP.
3+
This repository is home to the code examples highlighted in various [Shopify API tutorials](http://docs.myshopify.io/api/tutorials/). They are designed solely for the purposes of introducing new developers to the Shopify API. The example apps are written in [Sinatra](https://github.com/sinatra/sinatra), but the concepts presented will also apply to developers building applications in other languages such as Python, Node.js and PHP.
44

55
## Tutorial index
66

@@ -13,19 +13,15 @@ This repository is home to the code examples highlighted in various [Shopify API
1313
## Requirements
1414

1515
* [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
1716
* [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`
17+
* [Shopify Partners account](https://developers.shopify.com/)
2318

2419
## Credentials
2520

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).
21+
Follow [this guide](https://help.shopify.com/api/guides/api-credentials#generate-public-app-credentials) to obtain your public app credentials from your Shopify Partners account.
22+
23+
This example apps use a `.env` file to store app credentials. After cloning the repository, you will need to create a file named .env in the same folder of the tutorial. Copy the values of the API Key and API Secret from your partner dashboard, and add them to the .env file in the following format:
2724

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:
2925
```
3026
API_KEY=YOUR_API_KEY
3127
API_SECRET=YOUR_SECRET_KEY
@@ -35,8 +31,17 @@ where `YOUR_API_KEY` and `YOUR_SECRET_KEY` are the values of your application's
3531

3632
## App URL
3733

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.
34+
This tutorial series uses [ngrok](https://ngrok.com/) to create a secure tunnel from the 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 the [Building a public Shopify application](http://docs.myshopify.io/api/tutorials/building-public-app/#configure-app) tutorial.
3935

40-
## Running the apps
36+
## Running the app
4137

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`.
38+
``` sh
39+
# navigate to the correct tutorial
40+
$ cd 01\ Getting\ Started/
41+
# create the .env and copy your API key and API secret values
42+
$ echo $'API_KEY=YOUR_API_KEY\nAPI_SECRET=YOUR_SECRET_KEY' >.env
43+
# install dependencies
44+
$ bundle install
45+
# run the app
46+
$ ruby app.rb
47+
```

0 commit comments

Comments
 (0)
0