/
README.markdown.template
108 lines (66 loc) · 2.1 KB
/
README.markdown.template
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Finatra [![Build Status](https://secure.travis-ci.org/capotej/finatra.png)](http://travis-ci.org/capotej/finatra)
Finatra is a sinatra-inspired web framework for scala, running on top of [Finagle](http://twitter.github.com/finagle/)
### Notes to users upgrading to 1.0.0 from earlier versions
* route parameters now live in ```request.multiParams```
* public assets now live in ```src/main/resources``` (can be configured, see below)
### Features
* Familiar routing DSL
* Asynchronous, uses [Finagle](http://twitter.github.com/finagle/)
* Multipart Upload
* File server with live asset reloading
* App Generator
* Mustache template support through [mustache.java](https://github.com/spullara/mustache.java)
* Heroku support out of the box
### Projects using finatra
[Zipkin](http://twitter.github.com/zipkin/) is an awesome distributed tracing system
[finatra-example](http://github.com/capotej/finatra-example) An example repo to get you started
### Example
```scala
object App {
###EXAMPLEAPP###
def main(args: Array[String]) = {
FinatraServer.register(app)
FinatraServer.start()
}
```
### Generating your own finatra app
```sh
$ git clone https://github.com/capotej/finatra.git
$ cd finatra
$ ./finatra new com.example.myapp /tmp
```
That will generate ```/tmp/myapp/```, start it up like so:
```sh
$ cd /tmp/myapp
$ mvn scala:run
```
You should now have finatra running on port 7070!
### Installing the generator
For bash users:
echo 'eval "$(./finatra init -)"' >> ~/.bash_profile
exec bash
For zsh users:
echo 'eval "$(./finatra init -)"' >> ~/.zshenv
source ~/.zshenv
Now you can run ```finatra new``` from anywhere.
### Configuration
Available configuration properties and their defaults
```sh
-Dname=finatra
-Dlog_path=logs/finatra.log
-Dlog_node=finatra
-Dport=7070
-Dlocal_docroot=src/main/resources
-Dpid_enabled=false
-Dpid_path=finatra.pid
-Denv=development
```
### Installation via Maven
Add the dependency to your pom.xml
```xml
<dependency>
<groupId>com.twitter</groupId>
<artifactId>finatra</artifactId>
<version>###VERSION###</version>
</dependency>
```