Ray Lee 6 лет назад
Родитель
Сommit
67a45847ed
2 измененных файлов с 15 добавлено и 16 удалено
  1. 14 15
      README.md
  2. 1 1
      app/controllers/main_controller.rb

+ 14 - 15
README.md

@@ -1,24 +1,23 @@
 # README
+  Save data from chatfuel json api
 
-This README would normally document whatever steps are necessary to get the
-application up and running.
+## Ruby version
 
-Things you may want to cover:
+    ruby '2.5.1'
 
-* Ruby version
+## Rails version
 
-* System dependencies
+    gem 'rails', '~> 5.2.0'
 
-* Configuration
+## No Model (Database)
+  file all saved in /storage/.
 
-* Database creation
+## APIs
+### GET /event-key
+  get a hex code from server
 
-* Database initialization
+### POST /save-data/:event_key
+  put this string in your chatfuel json api url
 
-* How to run the test suite
-
-* Services (job queues, cache servers, search engines, etc.)
-
-* Deployment instructions
-
-* ...
+### GET /download-data/:event_key
+  download the newest report while you need

+ 1 - 1
app/controllers/main_controller.rb

@@ -43,6 +43,6 @@ class MainController < ApplicationController
   end
 
   def data_path
-    Rails.root.join("storage/#{@event_key}.csv")
+    @data_path ||= Rails.root.join("storage/#{@event_key}.csv")
   end
 end