Skip to content

Racjonalny-Traktor/Nomadic_Reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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