Skip to content

A RESTful API for a Blogging Site using Java Maven for server and MySQL for Database

Notifications You must be signed in to change notification settings

anandnkhl/Blog_REST_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This Java Maven projct is a RESTful API with GET, POST, DELETE and PUT functionality for a Blog.

To run this project Prerequisite:
- Eclipse IDE for Java EE or any Java IDE with Apache Maven support.
- MySQL 5.x
- MySQL Workbench or any other clients to access MySQL database
- Postman or any other REST Clients

Create A DB in MySQl "CREATE DATABASE user_db;"

In the file "src\main\resources\application.properties" set your MySQL user and password edit: spring.datasource.username= edit: spring.datasource.password=

Run the file "src\main\java\com\anandnkhl\blog_rest_API\App.java"

Once the Application is running use Postman or cURL(on CMD) for GET, POST, PUT, DELETE

Create Blog: POST request at "http://localhost:8080/users/" with JSON Body as: { "username": "anand", "password": "pass", "name": "Nikhil", "blog": "This is my new Blog. I am new to this" }

Get all Blog: GET request at "http://localhost:8080/users/"

Get particular Blog: GET request at "http://localhost:8080/users/"

Update Blog:(Requires both username and password) PUT request at "http://localhost:8080/users/{username}/{password}" with JSON Body as:

{ "username": "anand", "password": "Updatedpass", "name": "UpdatedNikhil", "blog": "This is my updated Blog. I am old to this" }

Delete Blog:(Requires both username and password) DELETE request at "http://localhost:8080/users/{username}/{password}"


To do:
1. Remove DB password for authentication
2. Add authentication

About

A RESTful API for a Blogging Site using Java Maven for server and MySQL for Database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages