You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,3 +2,54 @@ scala-api
2
2
=========
3
3
4
4
A simple api written in Scala using the Spray Framework.
5
+
6
+
Features
7
+
--------
8
+
9
+
The API includes the following libraries:
10
+
11
+
1. Spray.IO: This is the core of the API that allows users to generate API services.
12
+
The main components of spray.io are the **spray-servlet**, **spray-routing** and all the **Akka**-related dependencies.
13
+
Additionally we have added support for caching and json marshalling and unmarshalling using the **spray-caching** and **spray-json** dependencies.
14
+
2. Jetty: This is the application container.
15
+
3. Typesafe config: The application and the underlying **Akka** classes use the typesafe config system for configuration.
16
+
4. Slick: This is a library for database query and access that supports various underlying DBMSs. The user is free to use whatever they want and add the required connector later.
17
+
5. Testing tools: **Scalatest** is the preferred testing tool, together with **Mockito**.
18
+
6.**sbt-assembly**: For creating a fat jar with embedded Jetty for distribution.
19
+
7.**sbt-release**: For defining custom release steps.
20
+
21
+
Starting the Server
22
+
-------------------
23
+
24
+
Starting the server is relatively easy. There are two ways of doing this:
25
+
26
+
1. Without building the fat jar.
27
+
2. Building the fat jar and running it.
28
+
29
+
### Running the Application Through SBT
30
+
31
+
To run the application through SBT, run the following command:
32
+
33
+
> sbt container:start shell
34
+
35
+
It might take some time to compile if you haven't done this yet and then you will see a shell. Then your service will become available and you will be able to query it through the browser.
36
+
37
+
To stop the server, run:
38
+
39
+
> container:stop
40
+
41
+
### Running the Server Through a Fat JAR
42
+
43
+
For this operation you will need to create the fat jar first and then simply start it as normal Java application.
44
+
45
+
1. Building the fat jar:
46
+
> sbt assembly
47
+
2. Running the application:
48
+
> java -jar jar-name.jar
49
+
50
+
Then to stop the application, just press Ctrl+C.
51
+
52
+
Conclusion
53
+
----------
54
+
55
+
This is the skeleton application you can use to quickly start your development. From then on, it is up to you to add the dependencies you need and make the API do whatever you want.
0 commit comments