Skip to content

Commit e036ae3

Browse files
committed
review documentation prepare for 1.0.0 release fix #495
1 parent 7a74076 commit e036ae3

8 files changed

Lines changed: 143 additions & 26 deletions

File tree

jooby-crash/src/test/java/app/CrashApp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import org.jooby.Jooby;
44
import org.jooby.banner.Banner;
5-
import org.jooby.crash.HttpShellPlugin;
65
import org.jooby.crash.Crash;
6+
import org.jooby.crash.HttpShellPlugin;
77
import org.jooby.json.Jackson;
88

99
public class CrashApp extends Jooby {
@@ -12,7 +12,7 @@ public class CrashApp extends Jooby {
1212

1313
use(new Jackson());
1414

15-
use(new Banner("crash me"));
15+
use(new Banner("crash me!"));
1616

1717
use(new Crash()
1818
.plugin(HttpShellPlugin.class)

md/doc/crash/crash.md

Lines changed: 125 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,11 @@ import org.crsh.command.InvocationContext
106106

107107
class hello {
108108

109-
@Usage("Say Hello")
110-
@Command
111-
def main(InvocationContext context) {
112-
return "Hello"
113-
}
114-
109+
@Usage("Say Hello")
110+
@Command
111+
def main(InvocationContext context) {
112+
return "Hello"
113+
}
115114
}
116115
```
117116

@@ -120,16 +119,134 @@ Jooby adds some additional attributes and commands to `InvocationContext` that y
120119
* registry: Access to [Registry]({{defdocs}}/Registry.html).
121120
* conf: Access to `Config`.
122121

122+
Example:
123+
124+
```java
125+
package commands
126+
127+
import org.crsh.cli.Command
128+
import org.crsh.cli.Usage
129+
import org.crsh.command.InvocationContext
130+
131+
class HelloMyService {
132+
133+
@Usage("MySerivce.doSomething")
134+
@Command
135+
def execute(InvocationContext context) {
136+
def registry = context.registry
137+
138+
return registry.require(MySerivce.class).doSomething()
139+
}
140+
}
141+
```
142+
123143
### routes command
124144

125145
The ```routes``` print all the application routes.
126146

147+
```
148+
dev> routes
149+
order method pattern consumes produces name source
150+
-------------------------------------------------------------------------------------------------
151+
0 GET /shell/css/** [*/*] [*/*] /anonymous org.jooby.crash.WebShellPlugin:41
152+
0 GET /shell/js/** [*/*] [*/*] /anonymous org.jooby.crash.WebShellPlugin:42
153+
0 GET /shell [*/*] [*/*] /anonymous org.jooby.crash.WebShellPlugin:45
154+
0 GET /api/shell/{cmd:.*} [*/*] [*/*] /anonymous org.jooby.crash.HttpShellPlugin:43
155+
0 * {before}/path [*/*] [*/*] /anonymous app.CrashApp:21
156+
0 * {after}/path [*/*] [*/*] /anonymous app.CrashApp:24
157+
0 * {complete}/path [*/*] [*/*] /anonymous app.CrashApp:28
158+
0 GET / [*/*] [*/*] /anonymous app.CrashApp:31
159+
160+
161+
method pattern consumes produces
162+
-------------------------------------------------
163+
WS /shell application/json application/json
164+
```
165+
127166
### conf command
128167

129-
The ```conf tree``` print the application configuration tree (configuration precedence).
168+
The ```conf tree``` print the application configuration tree (configuration precedence):
169+
170+
```
171+
dev> conf tree
172+
merge of system properties
173+
org/jooby/crash/crash.conf @ file:/jooby-crash/target/classes/org/jooby/crash/crash.conf
174+
org/jooby/spi/server.conf @ file:/jooby-netty/target/classes/org/jooby/spi/server.conf
175+
org/jooby/mime.properties @ file:/jooby/target/classes/org/jooby/mime.properties
176+
org/jooby/jooby.conf @ file:/jooby/target/classes/org/jooby/jooby.conf: 1
177+
```
130178

131179
The ```conf props [path]``` print all the application properties, sub-tree or a single property if ```path``` argument is present.
132180

181+
```
182+
dev> conf props
183+
name value
184+
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
185+
mime.pgn application/x-chess-pgn
186+
os.version 10.11.6
187+
mime.ttf font/truetype
188+
err.java.io.FileNotFoundException 404
189+
sun.cpu.isalist
190+
mime.wtls-ca-certificate application/vnd.wap.wtls-ca-certificate
191+
mime.texinfo application/x-texinfo
192+
runtime.concurrencyLevel 8
193+
.....
194+
```
195+
196+
```
197+
dev> conf props application
198+
name value
199+
--------------------------------------------------------------------------------
200+
application.tmpdir /var/folders/9l/fyb_j4l553z6ql4443yttbj40000gn/T/app
201+
application.version 0.0.0
202+
application.ns app
203+
application.port 8080
204+
application.charset UTF-8
205+
application.redirect_https
206+
application.class app.CrashApp
207+
application.tz America/Argentina/Buenos_Aires
208+
application.numberFormat #,##0.###
209+
application.dateFormat dd-MMM-yyyy
210+
application.env dev
211+
application.host localhost
212+
application.name app
213+
application.path /
214+
application.lang en-US
215+
```
216+
217+
```
218+
dev> conf props application.port
219+
name value
220+
-----------------------
221+
application.port 8080
222+
```
223+
133224
## fancy banner
134225

135-
Just add the [jooby-banner](/doc/banner) to your project and all the `CRaSH` shell will use it. Simple and easy!!
226+
Just add the [jooby-banner](/doc/banner) to your project and all the `CRaSH` shell will use it.
227+
228+
229+
```java
230+
{
231+
use(new Banner("crash me!"));
232+
233+
use(new Crash());
234+
}
235+
```
236+
237+
telnet localhost 5000
238+
239+
```
240+
Trying 127.0.0.1...
241+
Connected to localhost.
242+
Escape character is '^]'.
243+
_____ _____
244+
__________________ __________ /_ ______ ___ ____ __ /
245+
___/_ ___/ __ `/_ ___/_ __ \ _ __ `__ \ _ \_ /
246+
/__ / /_/ / (__ ) / / / / / / / / __//_/
247+
___/ _/ __,_/ ____/ _/ /_/ _/ /_/ /_/ ___/ _) v0.0.0
248+
249+
dev>
250+
```
251+
252+
Simple and easy!!

md/doc/jetty/jetty.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# jetty
22

3-
NIO web server via: [Jetty](https://www.eclipse.org/jetty).
3+
[Jetty](https://www.eclipse.org/jetty) provides a Web server and javax.servlet container, plus support for HTTP/2, WebSocket and many other integrations.
44

55
## exports
66

md/doc/metrics/metrics.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,3 @@ Reporters are appended via a callback API:
9090
```
9191

9292
You can add all the reporters you want. Keep in mind you have to start them (if need it), but you don't have to stop them as long they implements the [Closeable]({{defdocs}}/assets/Closeable.html) interface.
93-
94-
That's all folks!

md/doc/netty/netty.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# netty
22

3-
NIO web server via [Netty](http://netty.io).
3+
[Netty](http://netty.io) is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.
44

55
## exports
66

7-
* Netty Server
7+
* `Server`
88

99
## dependency
1010

@@ -19,7 +19,6 @@ NIO web server via [Netty](http://netty.io).
1919
## usage
2020

2121
In order to use a web server all you have to do is add the dependency to your build system.
22-
{{Jooby}} will find the server and start it.
2322

2423
## http/2
2524

@@ -31,4 +30,6 @@ In order to use a web server all you have to do is add the dependency to your bu
3130
| Yes | Yes | Yes |
3231
```
3332

33+
No extra configuration is necessary.
34+
3435
{{appendix}}

md/doc/servers/servers.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# servers
22

3-
Run your application on top of your favorite server! Just change one line and switch between {{netty}}, {{jetty}} or {{undertow}}!!
3+
Run your application on top of your favorite server!
4+
5+
Change one line and switch between {{netty}}, {{jetty}} or {{undertow}}!!
46

57
{{doc/netty/netty.md}}
68

md/doc/undertow/undertow.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# undertow
22

3-
NIO web server via [Undertow](http://undertow.io/).
3+
[Undertow](http://undertow.io/) is a flexible performant web server written in java, providing both blocking and non-blocking API’s based on NIO.
44

55
## exports
66

7-
* Undertow server
7+
* `Server`
88

99
## dependency
1010

@@ -19,7 +19,6 @@ NIO web server via [Undertow](http://undertow.io/).
1919
## usage
2020

2121
In order to use a web server all you have to do is add the dependency to your build system.
22-
{{Jooby}} will find the server and start it.
2322

2423
## http/2
2524

@@ -31,7 +30,7 @@ In order to use a web server all you have to do is add the dependency to your bu
3130
| Yes | Yes | Yes |
3231
```
3332

34-
You need `Java 8 Update 71` or higher (integration tests run in `Java 8 Update 101`).
33+
You need `Java 8 Update 71` or higher (integration tests uses `Java 8 Update 101`).
3534

3635
See [Java 8 releases](https://www.java.com/en/download/faq/release_dates.xml) for more details.
3736

md/war.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ In order to deploy into a Servlet Container, we need to generate a ```*.war``` f
1515

1616
* web-sockets are not supported
1717
* some properties has no effect when deploying into a Servlet Container:
18-
- application.path / contextPath
19-
- appplication.port
20-
- max upload file sizes
21-
- any other server specific property: server.*, jetty.*, netty.*, undertow.*
18+
- application.path / contextPath
19+
- appplication.port
20+
- max upload file sizes
21+
- any other server specific property: server.*, jetty.*, netty.*, undertow.*
2222

2323

2424
### special note on contextPath
@@ -37,7 +37,7 @@ For example:
3737
</html>
3838
```
3939

40-
Here the expression: ```{{ "{{contextPath" }}}}``` correspond to the template engine (handlebars here) or ```${contextPath}``` for Freemarker.
40+
Here the expression: ```{{contextPath}}``` corresponds to the template engine (handlebars here) or ```${contextPath}``` for Freemarker.
4141

4242
## how it works?
4343

0 commit comments

Comments
 (0)