Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Floppahost/backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

102 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository is now archived, meaning we do not provide support for this anymore.

🚧 API Routes

[POST] /login

Request

{
  username: string;
  password: string;
}

Response

  • ✅ Status: 200
auth: true,
error: false,
message: "Logged In",

cookies: {
token: JWT
}
  • ❌ Status: 401
auth: false,
error: false,
message: "Invalid data",

[POST] /status

Request

headers: {
  Authorization: JWT;
}

Response

  • ✅ Status: 202
auth: true,
error: false,
message: "Authenticated"
  • ❌ Status: 403
auth: false,
error: false,
message: "Not authorized"

[GET] /profile/get/<username> — not ready yet

Request

headers: {
Authorization: JWT
},

Response

  • ✅ Status: 200
auth: true,
error: false,
message: "User fetched",

data: {
username: string,
uid: string,
avatar: string,
bio: string,
uploads: string // upload counter—the user can toggle this in settings
}
  • ❌ Status: 401, 404

    • 401 when not authorized
    • 404 when the user doesn't exist

[POST] /files/upload

Request

headers: {
Authorization: JWT
},

file: formFile
  • ✅ Status: 200

  • ❌ Status: 401, 404

    • 401 when not authorized
    • 404 when the user doesn't exist

[POST] /admin/wave

Request

headers: {
Authorization: JWT
},
  • ✅ Status: 200

  • ❌ Status: 401, 501

    • 501 when the invite system is disabled
    • 401 when the user is unauthorized

[POST] /auth/register

Request

body: {
    username: string,
    email: string,
    password: string,
    invite: string
}

If the invite system is disabled, we just ignore the invite

  • ✅ Status: 200

  • ❌ Status: 400

[POST] /admin/invite/user

Request

headers: {
Authorization: JWT
},

username: string
  • ✅ Status: 200

  • ❌ Status: 401, 501

    • 501 when the invite system is disabled
    • 401 when the user is unauthorized
    • 404 when the user doesn't exist

[POST] /admin/blacklist

Request

headers: {
Authorization: JWT
},

username: string
reason: string
  • ✅ Status: 200

  • ❌ Status: 401, 404

    • 401 when the user is unauthorized
    • 404 when the user doesn't exist

[POST] /admin/unblacklist

Request

headers: {
Authorization: JWT
},

username: string
  • ✅ Status: 200

  • ❌ Status: 401, 404

    • 401 when the user is unauthorized
    • 404 when the user doesn't exist

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages