Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daniel-cottone/photoalbum-api
RESTful API written in Java using Spring Framework.
https://github.com/daniel-cottone/photoalbum-api
crud-actions java rest rest-api restful restful-api spring spring-boot spring-data spring-framework
Last synced: 2 months ago
JSON representation
RESTful API written in Java using Spring Framework.
- Host: GitHub
- URL: https://github.com/daniel-cottone/photoalbum-api
- Owner: daniel-cottone
- License: mit
- Created: 2015-06-02T01:53:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-13T18:57:54.000Z (about 9 years ago)
- Last Synced: 2024-10-11T16:04:43.070Z (2 months ago)
- Topics: crud-actions, java, rest, rest-api, restful, restful-api, spring, spring-boot, spring-data, spring-framework
- Language: Java
- Homepage:
- Size: 400 KB
- Stars: 25
- Watchers: 5
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
#PhotoAlbum
##About
This is an example RESTful API written in Java and Spring Framework. This project is intended to be a demonstration of how a REST API can be structured and designed using Spring Boot/Actuator and Spring Data.##Installation
To run this application you will first need to install a couple packages: jdk 1.7 and maven (you can also install these packages with yum, brew, etc.)```
sudo apt-get install openjdk-7-jre
sudo apt-get install maven
```This project is built using Spring Boot/Spring Actuator, which makes it very easy to get running. You can either run the application directly from maven: `mvn spring-boot:run`, or you can build the application package with `mvn clean package` and then run the jar directly: `java -jar target/PhotoAlbum-1.0-SNAPSHOT.jar`.
##Usage
The default username/password for this application is `user:user`. To access any of the endpoints you will be prompted for authorization.The relevant endpoints for this application are `/api/photos` and `/api/albums`. Both endpoints have the basic CRUD actions. For example, to view all photos, you can navigate to:
```
http://localhost:8080/api/photos
```Which should return the following JSON:
```
[
{
"id": "1",
"title": "just me",
"createdDate": "2015-08-31T09:14:05.097-0500",
"filePath": "me.png",
"albumId": "1"
},
{
"id": "2",
"title": "another pic",
"createdDate": "2015-08-31T09:14:05.097-0500",
"filePath": "another.png",
"albumId": "1"
},
{
"id": "3",
"title": "profile photo",
"createdDate": "2015-08-31T09:14:05.098-0500",
"filePath": "profile.png",
"albumId": "1"
},
{
"id": "4",
"title": "at the beach",
"createdDate": "2015-08-31T09:14:05.098-0500",
"filePath": "beach.png",
"albumId": "2"
},
{
"id": "5",
"title": "at the park",
"createdDate": "2015-08-31T09:14:05.098-0500",
"filePath": "park.png",
"albumId": "2"
}
]
```For testing all of the CRUD actions, I recommend using [Postman](www.getpostman.com).