Skip to content

Latest commit

 

History

History
86 lines (83 loc) · 1.47 KB

README.md

File metadata and controls

86 lines (83 loc) · 1.47 KB

Routes

/actions/book

  • get // returns all books
{
    "success": boolean,
    "data": [
        {
            "print": string,
            "_id": string,
            "title": string,
            "desc": string,
            "author": string,
            "file": {
                "fieldname": string,
                "originalname": string,
                "encoding": string,
                "mimetype": string,
                "destination": string,
                "filename": string,
                "path": string,
                "size": number
            },
            "__v": number
        }
    ]
}
  • post + file (name need to be bookFile) // adds book
{
	"title": string,
	"desc": string,
	"author": string,
	"print": ?string
}

in html file:

<form action="/actions/book" method="post" enctype="multipart/form-data">
  <input type="file" name="bookFile" />
</form>
  • delete // removes book
{
    "id": string
}
  • patch // edits book
{
    "id": string,
    "data": {
        // here things to change
    }
}

/beacons/verify

  • post // checks is user in the bus
{
    "tagName": string
}

/beacons/buses

  • get // all buses data
{
    "success": boolean,
    "data": [
        {
            "usersToday": number,
            "readingUsersToday": number,
            "_id": string,
            "line": string,
            "beaconsTagName": string
        }
    ]
}

/reading/ebook/:id

  • get // pdf file - stream