The messages are stored in a mongoDB database.
The Web services used by the mobile applications are exposed through Unfiltered.
To install it on your system, see here.
We are using the non released version 3.0.0-SNAPSHOT due to some bugs fixed in this version.
Before running the Administration or API app, you need to install on you local repository the 3.0.0-SNAPSHOT version of Casbah.
$ git clone git://github.com/mongodb/casbah.git
$ cd casbah
$ sbt publish-local
See the install instructions.
$ cd backend/sosmessage-api
$ sbt run
The SosMessage API will be accessible at http://localhost:3000/api/v1/...
.
http://localhost:3000/api/v1/categories
: all categories;http://localhost:3000/api/v1/category/{categoryId}/messages
: all the messages of the given category;http://localhost:3000/api/v1/category/{categoryId}/message
: one random message of the given category.
$ cd backend/sosmessage-api
$ sbt one-jar
You can then launch the server with:
$ java -jar sosmessage-api_2.9.1-2.1-SNAPSHOT-one-jar.jar
To change the default configuration, you can define your own configuration file through a system property:
$ java -Dsosmessage.configurationFile=conf/sosmessage.conf -jar sosmessage-api_2.9.1-2.1-SNAPSHOT-one-jar.jar
A configuration file looks like (those are the default values):
database {
host = 127.0.0.1
port = 27017
name = sosmessage
}
server {
port = 3000
}
Logging is done through Logback.
To override the default configuration, you can use the one in conf/
by specifying it as a system property:
$ java -Dlogback.configurationFile=conf/logback.xml -jar sosmessage-api_2.9.1-2.1-SNAPSHOT-one-jar.jar
See how to configure Logback here.