Skip to content

Simple Java JSON/REST web-services project with database integration, suitable for Heroku

Notifications You must be signed in to change notification settings

rjstanford/jaxrs-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jaxrs-example

This is a simple Java JSON/REST web-services project example with database integration, suitable for Heroku. Its pretty basic, but exposes a self-documenting (if silly) database-backed RESTful API with a minimum of code.

It uses:

The APIs are all served from the /api/ endpoint. To make things interesting I've included the Swagger GUI client at /swagger/ - note that this is absolutely not needed for deployment, and you can use any REST client to access the API endpoints. The endpoints are documented at /api/api-docs/ which is where this copy of Swagger will look by default when its accessed.

Finally it assumes that you have a DATABASE_URL environment variable set similar to:

export DATABASE_URL=postgres://dbuser:dbpass@localhost/databasename

To run it on a self-contained Heroku environment, simply install git and the heroku toolbelt locally and issue the following commands:

git clone https://github.com/rjstanford/jaxrs-example.git;
heroku create;
heroku addons:add heroku-postgresql;
heroku ps:scale web=1;
git push heroku master;

Access it through the URL that Heroku gives you and you should be good to go.

About

Simple Java JSON/REST web-services project with database integration, suitable for Heroku

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published