schemaless_rest_api 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 983c38081a6ee3d08a9d75b2e9425899329d1df050974088a5aac6eb21d924e5
4
- data.tar.gz: 2ed42db41c915a2106da88ac4d9179ea5bc55a8a594ec47dd0bc89f93f3ca8ef
3
+ metadata.gz: 1c6884db983603d3fe99853d2daf2448c5a112535d427c4dcf93085c03d0d572
4
+ data.tar.gz: 233cf6a115128268144a612ff02e5de53c32b4f1dc0cb3e46a53f15ebc776e9d
5
5
  SHA512:
6
- metadata.gz: ceafb7b6ed5b550dd7aae21ab964ec181ccb2b82221aaaf931596c5a379bbd4a4881eecda5b9896fb4179adb8ab6f37197b320cf6018213fda5979e42c266474
7
- data.tar.gz: 276bb03925b12bc91bebeee8344b863033b237b336880a799ee7f309a90e27d4d8f86ab0a3c4a532e2e23cc001eacf1c9d9b14d6d3dd8991c694edad4407c449
6
+ metadata.gz: 6fddf98f70498d9efee708f86ba28a3ddc4da8b53c029886c964ba8be2078d8bc459d025c50236bb11c9992a8a4ef5edd62d3a05491d8686ac481c2d6a61238a
7
+ data.tar.gz: ad73ffe9c66723853b0e0a9dc6ecaeb30371b7b12ceb33267715de10dcac052bb3d2107ad3fd4d93bff978239077d2a9434e526b8a32dc550676145b4d0b7db9
@@ -51,6 +51,7 @@ class RestServer < Sinatra::Base
51
51
  end
52
52
  post "/#{model.downcase}" do
53
53
  response["Access-Control-Allow-Origin"] = "*"
54
+ SchemalessRestApi.logger.info "POST #{request.fullpath}"
54
55
  data = JSON.parse(request.body.read)
55
56
  id = ""
56
57
  if data["id"]
@@ -81,7 +82,7 @@ class RestServer < Sinatra::Base
81
82
  end
82
83
  get "/#{model.downcase}" do
83
84
  response["Access-Control-Allow-Origin"] = "*"
84
- SchemalessRestApi.logger.info request.fullpath
85
+ SchemalessRestApi.logger.info "GET #{request.fullpath}"
85
86
  if ENV["mongodb"]
86
87
  if params == {}
87
88
  JSON.generate(MongoClient.get_all(model))
@@ -107,7 +108,7 @@ class RestServer < Sinatra::Base
107
108
  end
108
109
  get "/#{model.downcase}/:id" do |id|
109
110
  response["Access-Control-Allow-Origin"] = "*"
110
- puts request.path.downcase
111
+ SchemalessRestApi.logger.info "GET #{request.fullpath}"
111
112
  if ENV["mongodb"]
112
113
  results = MongoClient.find(model, id)
113
114
  return not_have(id) unless results.first
@@ -135,7 +136,7 @@ class RestServer < Sinatra::Base
135
136
  end
136
137
  put "/#{model.downcase}/:id" do |id|
137
138
  response["Access-Control-Allow-Origin"] = "*"
138
- puts request.path.downcase
139
+ SchemalessRestApi.logger.info "PUT #{request.fullpath}"
139
140
  data = JSON.parse(request.body.read)
140
141
  if ENV["mongodb"]
141
142
  results = MongoClient.find(model, id)
@@ -156,7 +157,7 @@ class RestServer < Sinatra::Base
156
157
  end
157
158
  delete "/#{model.downcase}/:id" do |id|
158
159
  response["Access-Control-Allow-Origin"] = "*"
159
- puts request.path.downcase
160
+ SchemalessRestApi.logger.info "DEL #{request.fullpath}"
160
161
  if ENV["mongodb"]
161
162
  results = MongoClient.find(model, id)
162
163
  return not_have(id) unless results.first
@@ -3,5 +3,5 @@
3
3
  # typed: true
4
4
 
5
5
  module SchemalessRestApi
6
- VERSION = "0.3.3"
6
+ VERSION = "0.3.4"
7
7
  end
@@ -4,7 +4,7 @@
4
4
 
5
5
  require_relative "schemaless_rest_api/version"
6
6
  require_relative "schemaless_rest_api/entities"
7
-
7
+ require "tapioca"
8
8
  require "logger"
9
9
 
10
10
  require "json"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schemaless_rest_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Garratt