Skip to content

A seed and example project for a RESTful api using Springboot, Jersey, Hibernate and Jackson

Notifications You must be signed in to change notification settings

thoersch/spring-boot-rest-api-seed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Description

This is a seed and example project for building a RESTful API using the following technologies:

  • Java 8
  • Spring Boot
  • Jersey
  • Hibernate
  • Jackson
  • Spring DI
  • Postgresql

Install Postgresql

The seed project is using PostgreSQL 9.3+ and can be installed quite easily on mac, linux or windows following a guide

Create the database user

CREATE ROLE "SpringBootUser" LOGIN
  ENCRYPTED PASSWORD 'md513445691374efba1aaee7b0912e63af3'
  SUPERUSER INHERIT CREATEDB NOCREATEROLE NOREPLICATION;

Create the database

CREATE DATABASE "SpringBootRestApi"
  WITH ENCODING='UTF8'
       OWNER="SpringBootUser"
       CONNECTION LIMIT=-1;

Build the project

mvn clean install

Run the migrations

mvn liquibase:update -P local

Running the API

Start the service by running the following command:

java -jar target/spring-boot-rest-api-seed-1.0-SNAPSHOT.jar

You can now test the service by consuming the api on port 8080. Some routes you can try in your browser (GET requests):

You can add new content by posting payloads like below:

POST 127.0.0.1:8080/users
Content-Type: application/json
{
  "firstName": "you",
  "lastName": "here",
  "emailAddress": "[email protected]",
  "profilePicture": "yourface.png"
}

License

Copyright © 2014 Tyler Hoersch

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

A seed and example project for a RESTful api using Springboot, Jersey, Hibernate and Jackson

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages