falcon 0.35.5 → 0.35.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -27
- data/examples/sequel/Gemfile +4 -0
- data/examples/sequel/config.ru +8 -0
- data/examples/sequel/data.sqlite3 +0 -0
- data/falcon.gemspec +1 -1
- data/lib/falcon/adapters/response.rb +2 -2
- data/lib/falcon/command/host.rb +2 -0
- data/lib/falcon/command/serve.rb +2 -0
- data/lib/falcon/configuration/rack.rb +1 -1
- data/lib/falcon/controller/serve.rb +1 -0
- data/lib/falcon/service/application.rb +6 -2
- data/lib/falcon/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7d2d4155e79287bfe7dd04ae2c5cc534be8133858c69c1c053ce26b04f08d43
|
4
|
+
data.tar.gz: fa93053422138e450a6f2ba8f1fbb68c62c50286d1380e727a56f9c8529a575a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb2d35183a7dcb578cb0273a8d68b559837f9b02e5ed8202ff861a05d7af5c16b8c82a2fdf2238ca1a87a30954e515d788d53543b927038e3eb25978e802d806
|
7
|
+
data.tar.gz: 5cefb2f9b4211e7082b9ee26e869fbf160c8ff7955f2886649904d9842e1f194bb13c1fc97cf2b1773387f40dc3bf5970af4d16f91df47cd272260e0790d3361
|
data/README.md
CHANGED
@@ -47,39 +47,16 @@ Alternatively, install in terminal:
|
|
47
47
|
|
48
48
|
You can run `falcon serve` directly. It will load the `config.ru` and start serving on https://localhost:9292. Please [try the interactive online tutorial](https://katacoda.com/ioquatix/scenarios/falcon-introduction).
|
49
49
|
|
50
|
-
The `falcon serve` command has the following options for you to use:
|
51
|
-
|
52
|
-
```
|
53
|
-
$ falcon --help
|
54
|
-
falcon [--verbose | --quiet] [-h/--help] [-v/--version] <command>
|
55
|
-
An asynchronous HTTP server.
|
56
|
-
|
57
|
-
[--verbose | --quiet] Verbosity of output for debugging.
|
58
|
-
[-h/--help] Print out help information.
|
59
|
-
[-v/--version] Print out the application version.
|
60
|
-
<command> One of: serve, virtual. Default: serve
|
61
|
-
|
62
|
-
serve [-b/--bind <address>] [-p/--port <number>] [-h/--hostname <hostname>] [-t/--timeout <duration>] [--reuse-port] [-c/--config <path>] [--forked | --threaded | --hybrid] [-n/--count <count>] [--forks <count>] [--threads <count>]
|
63
|
-
Run an HTTP server.
|
64
|
-
|
65
|
-
[-b/--bind <address>] Bind to the given hostname/address Default: https://localhost:9292
|
66
|
-
[-p/--port <number>] Override the specified port
|
67
|
-
[-h/--hostname <hostname>] Specify the hostname which would be used for certificates, etc.
|
68
|
-
[-t/--timeout <duration>] Specify the maximum time to wait for blocking operations. Default: 60
|
69
|
-
[--reuse-port] Enable SO_REUSEPORT if possible. Default: false
|
70
|
-
[-c/--config <path>] Rackup configuration file to load Default: config.ru
|
71
|
-
[--forked | --threaded | --hybrid] Select a specific parallelism model Default: forked
|
72
|
-
[-n/--count <count>] Number of instances to start. Default: 8
|
73
|
-
[--forks <count>] Number of forks (hybrid only).
|
74
|
-
[--threads <count>] Number of threads (hybrid only).
|
75
|
-
```
|
76
|
-
|
77
50
|
To run on a different port:
|
78
51
|
|
79
52
|
```
|
80
53
|
$ falcon serve --port 3000
|
81
54
|
```
|
82
55
|
|
56
|
+
### Production
|
57
|
+
|
58
|
+
|
59
|
+
|
83
60
|
### Virtual Hosts
|
84
61
|
|
85
62
|
Falcon can replace Nginx as a virtual server for Ruby applications. **This is an experimental feature**.
|
Binary file
|
data/falcon.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_dependency 'samovar', "~> 2.1"
|
31
31
|
spec.add_dependency 'localhost', "~> 1.1"
|
32
|
-
spec.add_dependency 'build-environment', '~> 1.
|
32
|
+
spec.add_dependency 'build-environment', '~> 1.13'
|
33
33
|
|
34
34
|
spec.add_dependency 'process-metrics', '~> 0.1.0'
|
35
35
|
|
@@ -70,10 +70,10 @@ module Falcon
|
|
70
70
|
protocol = meta['rack.protocol']
|
71
71
|
|
72
72
|
# https://tools.ietf.org/html/rfc7231#section-7.4.2
|
73
|
-
|
73
|
+
headers.add('server', "falcon/#{Falcon::VERSION}")
|
74
74
|
|
75
75
|
# https://tools.ietf.org/html/rfc7231#section-7.1.1.2
|
76
|
-
|
76
|
+
headers.add('date', Time.now.httpdate)
|
77
77
|
|
78
78
|
return self.new(status, headers, body, protocol)
|
79
79
|
end
|
data/lib/falcon/command/host.rb
CHANGED
data/lib/falcon/command/serve.rb
CHANGED
@@ -35,7 +35,8 @@ module Falcon
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def middleware
|
38
|
-
|
38
|
+
# In a multi-threaded container, we don't want to modify the shared evaluator's cache, so we create a new evaluator:
|
39
|
+
@environment.evaluator.middleware
|
39
40
|
end
|
40
41
|
|
41
42
|
def preload!
|
@@ -61,11 +62,14 @@ module Falcon
|
|
61
62
|
end
|
62
63
|
|
63
64
|
def setup(container)
|
65
|
+
protocol = self.protocol
|
66
|
+
scheme = self.scheme
|
67
|
+
|
64
68
|
container.run(name: self.name, restart: true) do |instance|
|
65
69
|
Async(logger: logger) do |task|
|
66
70
|
Async.logger.info(self) {"Starting application server for #{self.root}..."}
|
67
71
|
|
68
|
-
server = Server.new(self.middleware, @bound_endpoint,
|
72
|
+
server = Server.new(self.middleware, @bound_endpoint, protocol, scheme)
|
69
73
|
|
70
74
|
server.run
|
71
75
|
|
data/lib/falcon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: falcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.35.
|
4
|
+
version: 0.35.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '1.
|
131
|
+
version: '1.13'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '1.
|
138
|
+
version: '1.13'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: process-metrics
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -302,6 +302,9 @@ files:
|
|
302
302
|
- examples/push/style.css
|
303
303
|
- examples/redis/Gemfile
|
304
304
|
- examples/redis/config.ru
|
305
|
+
- examples/sequel/Gemfile
|
306
|
+
- examples/sequel/config.ru
|
307
|
+
- examples/sequel/data.sqlite3
|
305
308
|
- examples/sinatra/Gemfile
|
306
309
|
- examples/sinatra/Gemfile.lock
|
307
310
|
- examples/sinatra/config.ru
|