-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathconfig-webapi.ru
More file actions
36 lines (28 loc) · 825 Bytes
/
config-webapi.ru
File metadata and controls
36 lines (28 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: utf-8 -*-
# HELLO
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
require 'rubygems'
require 'webapi'
require 'rack/cors'
Webapi::Configurations.load Webapi::Configurations::Webapi
Webapi.run_initializers('sequel')
if defined?(::Unicorn)
require 'unicorn/oob_gc'
use Unicorn::OobGC
require 'unicorn/worker_killer'
# Max requests per worker: 1000 reqs - 1200 reqs
use Unicorn::WorkerKiller::MaxRequests, 1000, 1200
# Max memory size (RSS) per worker: 300MB - 500MB
use Unicorn::WorkerKiller::Oom, ((300) * (1024**2)), ((500) * (1024**2))
end
map '/api' do
use Rack::Cors do
allow do
origins '*'
resource '*', :headers => :any, :methods => [:get, :post, :put, :delete, :options]
end
end
map '/0.0.1' do
run Webapi::Endpoints::V001::Webapi.new
end
end