Skip to content
Will Zeng edited this page Jan 31, 2015 · 2 revisions

Welcome to the Cograph wiki!

Some more than basic information about API routes will be kept here.

Routes

User System

  • / -> user-index.jade
  • /login -> login.jade
  • /signup -> signup.jade
  • /logout -> logs the user out
  • /profile -> profile.jade shows the profile of the logged in user
  • /landing -> landing.jade
  • /:userName/ -> profile.jade renders the profile of userName. This is the fallback route. It redirects to / if no user with that name is found.

Documents

  • /new -> creates a new document and redirects to:/:creatorUserName/document/:docId
  • /:creatorUserName/document/:docId -> index.jade renders the specified graphDoc
  • /:docId -> index.jade renders the specified graphDoc

Views

  • /:creatorUserName/document/:docId/view/:viewId -> index.jade renders the specified graphDoc and view
  • /:docId/view/:viewId -> index.jade renders the specified graphDoc and view
  • /:creatorUserName/document/:docId/search/:tag -> index.jade renders the specified graphDoc with nodes of only the specified tags
  • /:docId/search/:tag -> index.jade renders the specified graphDoc graphDoc with nodes of only the specified tags

Mobile

  • /mobile/:docId -> mobile.jade for the specified document

Errors

  • /errors/missingDocument -> errors/missingDocument.jade

API

This gives an overview of the static API. There's more that we do with sockets only that is not included here.

Documents

  • router.post '/document', documents.create
  • router.get '/document/:id', documents.read
  • router.get '/document', documents.getAll
  • router.put '/document/:id', documents.update
  • router.delete '/document/:id', documents.destroy

Analytics

  • router.get '/document/:id/analytics', documents.analytics
  • router.get '/document/:id/fullgraph', documents.fullgraph

Nodes

  • router.post '/document/:docId/nodes', nodes.create
  • router.get '/document/:docId/nodes/:id', nodes.read
  • router.get '/document/:docId/nodes', nodes.getAll
  • router.get '/document/:docId/nodes/:id/neighbors/', nodes.getNeighbors
  • router.get '/document/:docId/nodes/:id/spokes/', nodes.getSpokes
  • router.post '/document/:docId/nodes/:id/get_connections/', nodes.getConnections
  • router.put '/document/:docId/nodes/:id', nodes.update
  • router.delete '/document/:docId/nodes/:id', nodes.destroy

Connections

  • router.post '/document/:docId/connections', connections.create
  • router.get '/document/:docId/connections/:id', connections.read
  • router.get '/document/:docId/connections', connections.getAll
  • router.put '/document/:docId/connections/:id', connections.update
  • router.delete '/document/:docId/connections/:id', connections.destroy

Search

  • router.get '/document/:docId/nodes/names', search.getNodeNames
  • router.get '/document/:docId/getNodeByName', search.getNodeByName
  • router.get '/document/:docId/getNodesByTag', search.getNodesByTag
  • router.get '/document/:docId/getConnsByName', search.getConnsByName
  • router.get '/document/:docId/tags', search.getTagNames

Clone this wiki locally