git 테스트

sbkwgh e8f443abf1 Update server to not use sync; fix typo/bugs in migrations 8 yıl önce
config 403bdd0def Update config 8 yıl önce
lib df0a8eea88 Try to fix socket.io bug - still doesn't work but code in place for what *should* work (i.e. reloading the session in socket.io when users sends login message 8 yıl önce
migrations e8f443abf1 Update server to not use sync; fix typo/bugs in migrations 8 yıl önce
models c7e94d59ca Associate poll quesiton with thread and add test case constraints 8 yıl önce
routes 07a56dbce8 Add hasVoted parameter 8 yıl önce
test 07a56dbce8 Add hasVoted parameter 8 yıl önce
.gitignore df0a8eea88 Try to fix socket.io bug - still doesn't work but code in place for what *should* work (i.e. reloading the session in socket.io when users sends login message 8 yıl önce
LICENSE 2e15a2ca14 Create LICENSE 8 yıl önce
README.md 64e77a899b Update README.md 8 yıl önce
package.json df0a8eea88 Try to fix socket.io bug - still doesn't work but code in place for what *should* work (i.e. reloading the session in socket.io when users sends login message 8 yıl önce
server.js e8f443abf1 Update server to not use sync; fix typo/bugs in migrations 8 yıl önce

README.md

forum-backend

This is the backend (or 'api component') of the forum software to go along with the corresponding frontend project.

API Documentation

All API routes are prefixed /api/v1/

/admin_token

All sub-routes require admin privileges

/

  • Method: POST
  • Response: { id: <integer>, token: <string> }

/ban

All sub-routes require admin privileges

/

  • Method: POST
  • Data params:
    • message <string>
    • username <string>
    • canCreateThreads <boolean>
    • canCreatePosts <boolean>
    • ipBanned <boolean>
  • Response: { id: <integer>, message: <string>, canCreateThreads: <boolean>, canCreatePosts: <boolean>, ipBanned: <boolean>, User: { id: <integer>, username: <string>, description: <null | string>, color: <string>, createdAt: <string> }

/

  • Method: GET
  • Response: [{ id: <integer>, createdAt: <string>, updatedAt: <string>, canCreatePosts: <boolean>, canCreateThreads: <boolean>, ipBanned: <boolean>, message: <string>, UserId: <integer> }, ...]

/:id

  • Method: DELETE
  • URL params: id <integer>
  • Response: { success: true }

/category

/

  • Method: GET
  • Reponse: [{ color: <string>, createdAt: <string>, id: <integer>, name: <string>, updatedAt: <string>, value: <string> }, ...]

/:category

  • Method: GET
  • URL params: category <string>
  • Query params:
    • username <string, optional>
    • from <integer, optional>
    • limit <integer, optional>
  • Response: { name: <string>, value: <string>, color: <string>, [id: <integer>], [createdAt: <string>], [updatedAt: <string>], Threads: [ ... ], meta: { nextURL: <string | null>, nextThreadsCount: <integer> } }

/

  • Method: POST
  • Data params:
    • name <string>
    • color <string, optional>
  • Response: { color: <string>, createdAt: <string>, id: <integer>, name: <string>, updatedAt: <string>, value: <string> }
  • Notes: requires admin privileges

/:id

  • Method: PUT
  • URL params: id <integer>
  • Data params:
    • name <string, optional>
    • color <string, optional>
  • Response: { color: <string>, createdAt: <string>, id: <integer>, name: <string>, updatedAt: <string>, value: <string> }
  • Notes: requires admin privileges

/

  • Method: DELETE
  • URL params: id <integer>
  • Response: { success: true, otherCategoryCreated: <category object | null> }
  • Notes: requires admin privileges