https://github.com/tasxatzial/photobook-rest
https://github.com/tasxatzial/photobook-rest
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tasxatzial/photobook-rest
- Owner: tasxatzial
- Created: 2021-04-15T19:08:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-12T22:05:00.000Z (over 2 years ago)
- Last Synced: 2024-06-23T12:24:36.647Z (over 1 year ago)
- Language: Java
- Size: 61.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Photobook REST API
A basic REST API for the [photobook](https://github.com/tasxatzial/photobook) project. Written with the Java [Spark](https://sparkjava.com/) framework.
The following methods have been implemented:
* get("/users")
* post("/users")
* options("/users")
* get("/users/:username")
* put("/users/:username")
* options("/users/:username")
* get("/posts")
* options("/posts")
* get("/posts/:postID")
* options("/posts/:postID")
* get("/users/:username/posts")
* post("/users/:username/posts")
* options("/users/:username/posts")
* get("/users/:username/posts/:postID")
* options("/users/:username/posts/:postID")
* delete("/users")
* put("/users")
* post("/users/:username")
* delete("/users/:username")
* post("/posts")
* delete("/posts")
* put("/posts")
* post("/posts/:postID")
* delete("/posts/:postID")
* put("/posts/:postID")
* delete("/users/:username/posts")
* put("/users/:username/posts")
* post("/users/:username/posts/:postID")
* delete("/users/:username/posts/:postID")
* put("/users/:username/posts/:postID")
## Compile
Requirements: Java (8 or 11) & Maven 3.6
From the command line switch to the root folder of the project and run:
mvn dependency:copy-dependencies
mvn package
The first command should copy all .jar dependecies in the 'target/dependency' folder. The second command should build the final executable jar file in the 'target' folder.
## Run
Switch to the 'target' folder and run:
java -jar rest-1.0-SNAPSHOT.jar