Skip to content

masa67/jng-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a simple demo on implementing a RESTful service with Java Spring and AngularJS.

The demo takes the mean-template and replaces Node and Express with Spring. The used database is still MongoDB.

The demo is built in the spirit of Spring Guides and Spring Boot:

  • The application can be "just run", i.e., additional environments (like Tomcat) are not required, except MongoDB.
  • The configuration is based on Auto-Configuration and annotations (no web.xml).

For MongoDB, the used database is "mean-template-3", collection "userlist". This is inline with mean-template, so the environments cam be run against the same database/collection.

A couple of changes were required to the Angular part:

  • The logic how Spring handles MongoDB _id was not clear. Spring sends id instead of _id, and there was no success in trying to change that behaviour.
  • params were added to deleteUser (Users.js). Not clear why the original example is functional without this.

Installation

Install MongoDB. Start the daemon.

Use Maven to build the Java application:

    $ mvn package

Execution

Start the application:

    $ java -jar target/jng-template-3.0.jar

Go to: http://localhost:8080.

Versions

  • v.3.0:
    • Introduced application.properties, configures the name of the database.
    • index.html to show the version number from pom.xml via Maven resource filtering.
    • WARNING: instability with Maven builds in STS, sometimes the application works, sometimes not. Root cause unknown.
  • v.2.0: Added guidelines for running from command line.
  • v.1.0: The first functional version.

About

A demo and a template for a RESTful service with Java Spring and AngularJS.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors