Skip to content

Youstart-Labs/api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Api

Starting server

$ npm install
$ node .

Models

Person [extends User]

  • firstName*: string
  • lastName*: string
  • npi*: string
  • city: string
  • state: string
  • email*: string
  • password*: string
  • info: string
  • title*: string
  • profileImage: string

Category

  • title*: string
  • description: string
  • image*: string

Device

  • name*: string
  • category*: ObjectId
  • image*: string
  • website*: string
  • description: string

Review

  • user*: ObjectId
  • device:* ObjectId
  • rating*: number
  • comment: string

Question

  • user*: ObjectId
  • title*: string
  • description*: string

Relations

  • Person has_many Reviews
  • Person has_many Questions
  • Category has_many Devices
  • Device has_many Reviews
  • Device belongs_to category
  • Review belongs_to Person
  • Review belongs_to Device
  • Question belongs_to Person

API Once you create a container, it will provide both a REST and Node API, as described in the following table.

Description

Container Model Method

REST URI
List all containers.

getContainers(cb)

 

GET
/api/containers
Get information about specified container. getContainer(container, cb) GET
/api/containers/:container
Create a new container. createContainer(options, cb) POST
/api/containers
Delete specified container. destroyContainer(container, cb) DELETE
/api/containers/:container
List all files within specified container. getFiles(container, download, cb) GET
/api/containers/:container/files
Get information for specified file within specified container. getFile(container, file, cb) GET
/api/containers/:container/files/:file
Delete a file within a given container by name. removeFile(container, file, cb) DELETE /api/containers/:container/files/:file
Upload one or more files into the specified container. The request body must use multipart/form-data which the file input type for HTML uses. upload(req, res, cb) POST
/api/containers/:container/upload
Download a file within specified container. download(container, file, res, cb) GET
/api/containers/:container/download/:file
Get a stream for uploading. uploadStream(container, file, options, cb)  
Get a stream for downloading. downloadStream(container, file, options, cb)  

Releases

No releases published

Packages

No packages published