Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shofiq0023/infocave-blogs

Info cave backend. Blogs crud operation and user related operations are done here. User list fetch, login system etc
https://github.com/shofiq0023/infocave-blogs

cache heroku java postgresql rest-api spring-boot

Last synced: 13 days ago
JSON representation

Info cave backend. Blogs crud operation and user related operations are done here. User list fetch, login system etc

Awesome Lists containing this project

README

        

# Info-Cave Blogs

Blogs operations are done in this project

## Endpoints:

### **For Blogs:**

Main endpoint: **/api/blogs**

REST api link: [In heroku blogs](https://infocave.herokuapp.com/api/blogs)

Variables:

- **/get/all** : fetches all the blogs from DB.

- **/get/all/author/{authorId}** : fetches all blogs by author id.

- **/get/{blogId}** : gets a single blog by blog id.

- **/add** : adds a new blog to the DB.

Header:

```json
{
"Content-Type": "application/json"
}
```

Body:

```json
{
"title": "The Outsider",
"authorId": 2154,
"snippet": "Alien invasion on earth",
"detail": "this is where the actual blogs is written"
}
```

- **/update/{blogId}** : updates a blog by blog id. **Request body same as `/add`**

- **/delete/{blogId}** : deletes a blog by blog id.

---

### **For User**:

Main endpoint: **/api/users/**

REST api link: [In heroku users](https://infocave.herokuapp.com/api/users)

Variables:

- **/get/all** : gets all user detail from DB.

- **/get/{userId}** : gets a single user detail using user id from DB.

- **/add** : adds a new user to DB.

Header:

```json
{
"Content-Type": "application/json"
}
```

Body:

```json
{
"name": "John Doe",
"authorName": "john",
"email": "[email protected]",
"password": "johndoe123"
}
```

**Password will be encoded in the backend**

- **/delete/{userId}** : deletes a user using user id. Returns a message.

- **/login** : login with email and password. Returns boolean if credentials matches with database.

Header:

```json
{
"Content-Type": "application/json"
}
```

Body:

```json
{
"email": "[email protected]",
"password": "johndoe123"
}
```