api controller
This commit is contained in:
@@ -380,8 +380,5 @@ DEPENDENCIES
|
|||||||
web-console (>= 3.3.0)
|
web-console (>= 3.3.0)
|
||||||
whenever
|
whenever
|
||||||
|
|
||||||
RUBY VERSION
|
|
||||||
ruby 2.4.1p111
|
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.0.2
|
2.0.2
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
class Api::ApiController < ActionController::API
|
class Api::ApiController < ActionController::API
|
||||||
include TokenVerification, MultiTenancy
|
include TokenVerification
|
||||||
include ActionController::MimeResponds
|
include ActionController::MimeResponds
|
||||||
|
|
||||||
before_action :core_allow
|
before_action :core_allow
|
||||||
helper_method :current_token, :current_login_employee, :get_cashier
|
helper_method :current_token, :current_login_employee, :get_cashier
|
||||||
|
|
||||||
before_action :core_allow
|
|
||||||
|
|
||||||
def core_allow
|
def core_allow
|
||||||
headers['Access-Control-Allow-Origin'] = '*'
|
headers['Access-Control-Allow-Origin'] = '*'
|
||||||
headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'
|
headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ class Api::ShopsController < Api::ApiController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@shops = Shop.select('id,logo,name,shop_code,address,phone_no').all
|
@shops = Shop.select('id,logo,name,shop_code,address,phone_no').all
|
||||||
|
# render :json => {:name => "any name"}
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
application_path="#{File.expand_path("../..", __FILE__)}"
|
# application_path="#{File.expand_path("../..", __FILE__)}"
|
||||||
directory application_path
|
# directory application_path
|
||||||
#environment ENV.fetch("RAILS_ENV") { "production" }
|
# #environment ENV.fetch("RAILS_ENV") { "production" }
|
||||||
environment "production"
|
# environment "production"
|
||||||
pidfile "#{application_path}/tmp/puma/pid"
|
# pidfile "#{application_path}/tmp/puma/pid"
|
||||||
state_path "#{application_path}/tmp/puma/state"
|
# state_path "#{application_path}/tmp/puma/state"
|
||||||
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
||||||
port ENV.fetch("PORT") { 62158 }
|
# port ENV.fetch("PORT") { 62158 }
|
||||||
workers 2
|
# workers 2
|
||||||
preload_app!
|
# preload_app!
|
||||||
threads 1,1
|
# threads 1,1
|
||||||
|
|||||||
Reference in New Issue
Block a user