From be8cf2c34ee62dbaeac41c4936dab013317985ac Mon Sep 17 00:00:00 2001 From: Nweni Date: Tue, 3 Dec 2019 16:46:52 +0630 Subject: [PATCH] api controller --- Gemfile.lock | 3 --- app/controllers/api/api_controller.rb | 4 +--- app/controllers/api/shops_controller.rb | 1 + config/puma.rb | 22 +++++++++++----------- dump.rdb | Bin 1864 -> 1864 bytes 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 730e1f37..50647fba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -380,8 +380,5 @@ DEPENDENCIES web-console (>= 3.3.0) whenever -RUBY VERSION - ruby 2.4.1p111 - BUNDLED WITH 2.0.2 diff --git a/app/controllers/api/api_controller.rb b/app/controllers/api/api_controller.rb index 7b9b0cf2..22488792 100755 --- a/app/controllers/api/api_controller.rb +++ b/app/controllers/api/api_controller.rb @@ -1,12 +1,10 @@ class Api::ApiController < ActionController::API - include TokenVerification, MultiTenancy + include TokenVerification include ActionController::MimeResponds before_action :core_allow helper_method :current_token, :current_login_employee, :get_cashier - before_action :core_allow - def core_allow headers['Access-Control-Allow-Origin'] = '*' headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS' diff --git a/app/controllers/api/shops_controller.rb b/app/controllers/api/shops_controller.rb index 23d50ebc..fb726e29 100644 --- a/app/controllers/api/shops_controller.rb +++ b/app/controllers/api/shops_controller.rb @@ -4,6 +4,7 @@ class Api::ShopsController < Api::ApiController def index @shops = Shop.select('id,logo,name,shop_code,address,phone_no').all + # render :json => {:name => "any name"} end def show diff --git a/config/puma.rb b/config/puma.rb index d24425ae..f0013d25 100755 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,11 +1,11 @@ -application_path="#{File.expand_path("../..", __FILE__)}" -directory application_path -#environment ENV.fetch("RAILS_ENV") { "production" } -environment "production" -pidfile "#{application_path}/tmp/puma/pid" -state_path "#{application_path}/tmp/puma/state" -stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" -port ENV.fetch("PORT") { 62158 } -workers 2 -preload_app! -threads 1,1 +# application_path="#{File.expand_path("../..", __FILE__)}" +# directory application_path +# #environment ENV.fetch("RAILS_ENV") { "production" } +# environment "production" +# pidfile "#{application_path}/tmp/puma/pid" +# state_path "#{application_path}/tmp/puma/state" +# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" +# port ENV.fetch("PORT") { 62158 } +# workers 2 +# preload_app! +# threads 1,1 diff --git a/dump.rdb b/dump.rdb index a68175fafab144fc16d0593815907ec4f4fb994e..b94851f2964ddc5a569f60eaf2162701f9b6adb4 100644 GIT binary patch delta 177 zcmX@XcY<$%fw-0av)Er8rNyZ!y1A*jhd!+3WBAALTXeD_yTs&mZ0wUSu?e%7>lztM zY?Pk-oK1SNC!50Li)><(7$sONbd3!rr?Y8Id?Gd3pOI~{Kbr`fxvrtb0fvbS3@6Jo zim_Sf8W^loqF^=;o&89{RABkKrG~Z&3yYzT%R^603ru{N&VPpzHzm z$s5>2SS)mnEGM5})0n)0k!^A&qv7O@Y+{p*7{w<(mzw;6O%{mRCteX|v(z;(JixH| zGUGj#i49_tJsG8dI*kn{vodN;=4EFGicO3MlCl%8h)$d#Jy{c