add config
This commit is contained in:
parent
86b6f75eb7
commit
94480744c1
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
lib/
|
||||
config.yml
|
3
config.example.yml
Normal file
3
config.example.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
sms.ru:
|
||||
api_id: F1FC9A76-1408-E4CF-1F89-E7CC756762B6
|
@ -1,6 +1,10 @@
|
||||
require "yaml"
|
||||
require "http/client"
|
||||
|
||||
CONFIG = File.open("./config.yml") { |file| YAML.parse(file) }
|
||||
CONFIG.class
|
||||
|
||||
get "/api/v1.0/smsru_status" do
|
||||
response = HTTP::Client.get "https://sms.ru/my/free?api_id=F1FC9A76-1408-E4CF-1F89-E7CC756762B6&json=1"
|
||||
response = HTTP::Client.get "https://sms.ru/my/free?api_id=#{CONFIG["sms.ru"]["api_id"]}&json=1"
|
||||
response.body
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user