Skip to content

Croustys/blog-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog backend

Developed by Ákos Barabás & written in Go

For development purposes place .env file in root folder

API routes

POST

  • /login
  • /logout
  • /register
  • /create - post creation

GET

  • /user/{id}
  • /user -- returns the authenticated user's username, email
  • /posts?offset={1}&limit={1} -- optional parameters for lazy loading
  • /posts -- all posts
  • /post/{id} -- specific post
  • /ping -- just to see if the server is running properly

Technologies used

  • JWT - token based authentication
  • Bcrypt - password hashing
  • MongoDB - Document based Database

Usage

  • register
fetch("api.domain.com/register", {
  method: "POST",
  headers: {
    "Content-type": "application/json",
  },
  body: JSON.stringify({ username, email, password }),
});
  • login
fetch("api.domain.com/login", {
  method: "POST",
  headers: {
    "Content-type": "application/json",
  },
  body: JSON.stringify({ email, password }),
});
  • create post
fetch("api.domain.com/create", {
  method: "POST",
  headers: {
    "Content-type": "application/json",
  },
  body: JSON.stringify({ title, content }),
});

Hosted on Oracle

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published