Skip to content

sosmessage/sosmessagedecarte-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sosmessagedecarte - server part

Overview

The messages are stored in a mongoDB database.

The administration interface is done using Play 2.0.

The Web services used by the mobile applications are exposed through Unfiltered.

MongoDB

To install it on your system, see here.

Casbah

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

Administration

Install Play 2.0

See the Building from sources section here.

Launch the server

$ cd backend/sosmessage-admin
$ play run

The application will be accessible at http://localhost:9000/.

API

Install SBT

See the install instructions.

Launch the server

$ 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.

Build a single executable JAR

$ cd backend/sosmessage-api
$ sbt one-jar

You can then launch the server with:

$ java -jar sosmessage-api_2.9.1-1.3-SNAPSHOT-one-jar.jar

Configuration

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-1.3-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

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-1.3-SNAPSHOT-one-jar.jar

See how to configure Logback here.

About

Server part of sosmessagedecarte application

Resources

Stars

Watchers

Forks

Packages

No packages published