this API side app lets the user create blogs and comment on other users blogs
- NestJs
- Node.js
- ' GET /userAuth/all ' gets all users
- ' POST /userAuth/create ' posts a body containing a user object
- ' Post /post/postCreate ' posts a body containng a post object that directly determines its writter from the JSON
- ' Get /post/getPostOf/:id ' gets the posts associated with the userId provided
- ' Post /comment/commentCreate/postOfUser/:id/postNum/:postNumber ' creates a comment in the specified blog of the specified user
- User :
class User {
id: number;
name: string;
age: number;
blogs?: Blog[];
}- Blog :
export class Blog {
writer: number;
content: string;
comments?: Commentary[];
constructor(writer: number, content: string) {
this.content = content;
this.writer = writer;
this.comments = [];
}
}- Comment :
class Commentary {
writer?: number;
content: string;
constructor(content: string) {
this.content = content;
}
}