GithubHelp home page GithubHelp logo

liujiuwu / spray_mongo_rest_service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from izmailoff/spray_mongo_rest_service

0.0 0.0 0.0 397 KB

A complete example of a RESTful architecture that uses Spray, Akka, Rogue, Lift-Record, etc

License: Apache License 2.0

Scala 59.76% Shell 39.90% Lua 0.34%

spray_mongo_rest_service's Introduction

Build Status

[Build Status] (https://travis-ci.org/izmailoff/Spray_Mongo_REST_service)

Spray_Mongo_REST_service - TEMPLATE

A complete example of a RESTful architecture that uses:

You can use this project as a template for building REST services based on Spray and MongoDB.

To learn more about these technologies see the list of [references] (https://github.com/izmailoff/Spray_Mongo_REST_service/blob/master/docs/REFERENCES.md).

Big thanks for the SBT script and Run Mongo script to the linked repos.

Talk / Presentation

I gave a talk about this architecture for Sinagore Scala Programmers meetup Building RESTful applications with Spray and MongoDB. Presentation slides are here.

Installation

This section describes steps required to build, configure and run the application.

Building

Pre-Installation Steps

Install these applications on your dev machine in order to be able to build the src code:

  • Java Development Kit (JDK) >= 1.7
  • Optionally install SBT, or use one provided with the project (sbt)

Run SBT to generate executable JAR

SBT is a build tool that downloads source code dependencies, compiles code, runs tests, generates scaladocs, and produces executables.

Start up SBT from OS shell:

> sbt

or if it's not on a PATH:

> ./sbt

In SBT shell type (note semicolons):

;clean; assembly

You can also run it as a single command from OS shell:

> sbt clean assembly

This will run all tests and generate a single jar file named similar to: rest-assembly-0.1.jar.

Here is a full list of commands in case you want to generate IDE projects, documentation, etc:

> sbt clean compile test doc assembly eclipse

Look at the output to find where docs, jars, etc goes. You can open projects with Eclipse or IntelliJ afterwards. New versions of IntelliJ IDEA do not require generation of project files and can open SBT projects directly using Scala plugin.

System Requirements

To run compiled JAR file you should have installed:

Running

Run the JAR from your OS shell:

> java -jar rest-assembly-0.1.jar

This will run the application. In particular it will start a web server and will be ready to receive HTTP requests. Please use run scripts in production environment. They take care of runtime settings and environment, so that you don't have to.

Advanced Configuration

TODO

Accessing the Service

You can send requests to the web service with tools like curl on Unix systems, or you can open URLs in a browser.

Example shell scripts are provided to show sample requests you can do. They are located here.

spray_mongo_rest_service's People

Contributors

izmailoff avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.