Skip to content

forgiv/bloggy-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bloggy

Bloggy is a centralized blogging platform with posts written in markdown language.

Bloggy Server

API

auth

POST - /api/auth/login

request:

{ 
  username: String, 
  password: String
}

response:

{ 
  authToken: String 
}

POST - /api/auth/refresh

request:

{ 
  authToken: String 
}

response:

{ 
  authToken: String 
}

users

POST - /api/users

request:

{ 
  username: String, 
  password: String, 
  blog: String 
}

response:

{
  id: String,
  username: String,
  blog: String
}

GET - /api/users/[username]

response:

{ 
  blog: String 
}

GET - /api/users/[username]/posts

response:

[ 
  { 
    title: String, 
    content: String, 
    slug: String, 
    createdAt: DateString, 
    updatedAt: DateString 
  },
  ...
]

GET - /api/users/[username]/[slug]

response:

{ 
  title: String, 
  content: String, 
  slug: String, 
  createdAt: DateString, 
  updatedAt: DateString 
}

posts

POST - /api/posts

request:

{ 
  headers: { 
      authorization: 'Bearer [token]'
  }, 
  body: { 
    title: String, 
    slug: String, 
    content: String
  } 
}

response:

{ 
  status: 201, 
  body: { 
    title: String, 
    content: String, 
    slug: String, 
    createdAt: DateString, 
    updatedAt: DateString
  }
}

comments

POST - /api/comments

request:

{ 
  headers: { 
    authorization: 'Bearer [token]' 
  }, 
  body: { 
    content: String, 
    postId: String 
  } 
}

response:

{
  status: 201, 
  body: { 
    id: String, 
    content: String, 
    userId: String, 
    postId: String,
    createdAt: DateString,
    updatedAt: DateString 
  }
}

GET - /api/comments/[username]/[slug]

response:

[ 
  { 
    id: String, 
    content: String,
    userId: { 
      username: String
    }, 
    postId: String,
    createdAt: DateString, 
    updatedAt: DateString
  }
]

Tech/framework used

Built with

License

MIT © Hiram Cruz 2018

About

Server package for Bloggy platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published