From 3ae5cd1660c7b25900144d25fa83fcd7ef367937 Mon Sep 17 00:00:00 2001 From: gokhalevedant06 Date: Sun, 4 Dec 2022 07:02:22 +0530 Subject: [PATCH] Buffer Transfer API --- .DS_Store | Bin 0 -> 6148 bytes client/package-lock.json | 151 ++++++++++++++++++++++++++++ client/package.json | 1 + client/src/pages/book/Book.view.jsx | 37 +++++++ client/src/pages/book/sample.pdf | Bin 0 -> 3028 bytes client/src/routes/routes.index.js | 8 ++ client/yarn.lock | 62 +++++++++++- server/.DS_Store | Bin 6148 -> 6148 bytes server/routes/book.routes.js | 2 +- 9 files changed, 258 insertions(+), 3 deletions(-) create mode 100644 .DS_Store create mode 100644 client/src/pages/book/Book.view.jsx create mode 100644 client/src/pages/book/sample.pdf diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..14d97a4aa9a5543970765f6b1a6640a895171acd GIT binary patch literal 6148 zcmeHK%}N6?5dKEjQs|{eFG8N6;2W%^9z6F2q*aQr>_XL^^G1C{{bnYL+g$`Nf-(ci zmt=mj`Cu~{0J402xCZ6`rfiC$gAvi?QPo*7z95RmxNExYrs+1EYrwxC`t21K*x?B; zC*OZV-Qvx}jxxa(4ecJ$4s4I#*&f#Ww&~g(ZO9WQcxH?}4%+wkl&e9UFSaLfXc`g> z1Ovf9Fc1vwk&j_wYzof)U>{879}DLf>ZIiz-sJ{SlF`V5@=bgudT zmcP7WTSuhX`{4)lmTCG=09;)Ql!SOWLCboMv6}8Jcpm1!dm}se(6TL?+P3iii ZW9sXI*-@kDy15hMAz*|=7YzIY1MeE@JthDE literal 0 HcmV?d00001 diff --git a/client/package-lock.json b/client/package-lock.json index 6e351c0..48a0ee6 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -24,6 +24,7 @@ "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", "react-lottie": "^1.2.3", + "react-pdf": "^6.2.0", "react-redux": "^8.0.5", "react-router-dom": "^6.4.4", "react-scripts": "5.0.1", @@ -7253,6 +7254,11 @@ "url": "https://github.com/fb55/domhandler?sponsor=1" } }, + "node_modules/dommatrix": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dommatrix/-/dommatrix-1.0.3.tgz", + "integrity": "sha512-l32Xp/TLgWb8ReqbVJAFIvXmY7go4nTxxlWiAFyhoQw9RKEOHBZNnyGvJWqDVSPmq3Y9HlM4npqF/T6VMOXhww==" + }, "node_modules/domutils": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", @@ -12412,6 +12418,14 @@ "sourcemap-codec": "^1.4.8" } }, + "node_modules/make-cancellable-promise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/make-cancellable-promise/-/make-cancellable-promise-1.1.0.tgz", + "integrity": "sha512-X5Opjm2xcZsOLuJ+Bnhb4t5yfu4ehlA3OKEYLtqUchgVzL/QaqW373ZUVxVHKwvJ38cmYuR4rAHD2yUvAIkTPA==", + "funding": { + "url": "https://github.com/wojtekmaj/make-cancellable-promise?sponsor=1" + } + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -12434,6 +12448,14 @@ "semver": "bin/semver.js" } }, + "node_modules/make-event-props": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-event-props/-/make-event-props-1.3.0.tgz", + "integrity": "sha512-oWiDZMcVB1/A487251hEWza1xzgCzl6MXxe9aF24l5Bt9N9UEbqTqKumEfuuLhmlhRZYnc+suVvW4vUs8bwO7Q==", + "funding": { + "url": "https://github.com/wojtekmaj/make-event-props?sponsor=1" + } + }, "node_modules/makeerror": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", @@ -12471,6 +12493,11 @@ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, + "node_modules/merge-refs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/merge-refs/-/merge-refs-1.0.0.tgz", + "integrity": "sha512-WZ4S5wqD9FCR9hxkLgvcHJCBxzXzy3VVE6p8W2OzxRzB+hLRlcadGE2bW9xp2KSzk10rvp4y+pwwKO6JQVguMg==" + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -13201,6 +13228,23 @@ "node": ">=8" } }, + "node_modules/pdfjs-dist": { + "version": "2.16.105", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.16.105.tgz", + "integrity": "sha512-J4dn41spsAwUxCpEoVf6GVoz908IAA3mYiLmNxg8J9kfRXc2jxpbUepcP0ocp0alVNLFthTAM8DZ1RaHh8sU0A==", + "dependencies": { + "dommatrix": "^1.0.3", + "web-streams-polyfill": "^3.2.1" + }, + "peerDependencies": { + "worker-loader": "^3.0.8" + }, + "peerDependenciesMeta": { + "worker-loader": { + "optional": true + } + } + }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -14965,6 +15009,35 @@ "react": "^0.14.7 || ^15.0.0 || ^16.0.0" } }, + "node_modules/react-pdf": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-6.2.0.tgz", + "integrity": "sha512-FKUoUKKxoIipIbRHzXQZui1j+f1QcEuFuVL03qI1GFDm0jC4eUrMyOCpPR98lY7+rsCswPn1rjfKd+8k9PrZmQ==", + "dependencies": { + "@babel/runtime": "^7.0.0", + "clsx": "^1.2.1", + "make-cancellable-promise": "^1.0.0", + "make-event-props": "^1.1.0", + "merge-refs": "^1.0.0", + "pdfjs-dist": "2.16.105", + "prop-types": "^15.6.2", + "tiny-invariant": "^1.0.0", + "tiny-warning": "^1.0.0" + }, + "funding": { + "url": "https://github.com/wojtekmaj/react-pdf?sponsor=1" + }, + "peerDependencies": { + "file-loader": "^6.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "file-loader": { + "optional": true + } + } + }, "node_modules/react-redux": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz", @@ -16606,6 +16679,16 @@ "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==" }, + "node_modules/tiny-invariant": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", + "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" + }, + "node_modules/tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -17043,6 +17126,14 @@ "minimalistic-assert": "^1.0.0" } }, + "node_modules/web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "engines": { + "node": ">= 8" + } + }, "node_modules/web-vitals": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-2.1.4.tgz", @@ -23086,6 +23177,11 @@ "domelementtype": "^2.2.0" } }, + "dommatrix": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dommatrix/-/dommatrix-1.0.3.tgz", + "integrity": "sha512-l32Xp/TLgWb8ReqbVJAFIvXmY7go4nTxxlWiAFyhoQw9RKEOHBZNnyGvJWqDVSPmq3Y9HlM4npqF/T6VMOXhww==" + }, "domutils": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", @@ -26848,6 +26944,11 @@ "sourcemap-codec": "^1.4.8" } }, + "make-cancellable-promise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/make-cancellable-promise/-/make-cancellable-promise-1.1.0.tgz", + "integrity": "sha512-X5Opjm2xcZsOLuJ+Bnhb4t5yfu4ehlA3OKEYLtqUchgVzL/QaqW373ZUVxVHKwvJ38cmYuR4rAHD2yUvAIkTPA==" + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -26863,6 +26964,11 @@ } } }, + "make-event-props": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-event-props/-/make-event-props-1.3.0.tgz", + "integrity": "sha512-oWiDZMcVB1/A487251hEWza1xzgCzl6MXxe9aF24l5Bt9N9UEbqTqKumEfuuLhmlhRZYnc+suVvW4vUs8bwO7Q==" + }, "makeerror": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", @@ -26894,6 +27000,11 @@ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, + "merge-refs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/merge-refs/-/merge-refs-1.0.0.tgz", + "integrity": "sha512-WZ4S5wqD9FCR9hxkLgvcHJCBxzXzy3VVE6p8W2OzxRzB+hLRlcadGE2bW9xp2KSzk10rvp4y+pwwKO6JQVguMg==" + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -27392,6 +27503,15 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" }, + "pdfjs-dist": { + "version": "2.16.105", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.16.105.tgz", + "integrity": "sha512-J4dn41spsAwUxCpEoVf6GVoz908IAA3mYiLmNxg8J9kfRXc2jxpbUepcP0ocp0alVNLFthTAM8DZ1RaHh8sU0A==", + "requires": { + "dommatrix": "^1.0.3", + "web-streams-polyfill": "^3.2.1" + } + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -28482,6 +28602,22 @@ "lottie-web": "^5.1.3" } }, + "react-pdf": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-6.2.0.tgz", + "integrity": "sha512-FKUoUKKxoIipIbRHzXQZui1j+f1QcEuFuVL03qI1GFDm0jC4eUrMyOCpPR98lY7+rsCswPn1rjfKd+8k9PrZmQ==", + "requires": { + "@babel/runtime": "^7.0.0", + "clsx": "^1.2.1", + "make-cancellable-promise": "^1.0.0", + "make-event-props": "^1.1.0", + "merge-refs": "^1.0.0", + "pdfjs-dist": "2.16.105", + "prop-types": "^15.6.2", + "tiny-invariant": "^1.0.0", + "tiny-warning": "^1.0.0" + } + }, "react-redux": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz", @@ -29682,6 +29818,16 @@ "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==" }, + "tiny-invariant": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", + "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" + }, + "tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, "tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -30005,6 +30151,11 @@ "minimalistic-assert": "^1.0.0" } }, + "web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" + }, "web-vitals": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-2.1.4.tgz", diff --git a/client/package.json b/client/package.json index b434fd2..9a48a93 100644 --- a/client/package.json +++ b/client/package.json @@ -19,6 +19,7 @@ "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", "react-lottie": "^1.2.3", + "react-pdf": "^6.2.0", "react-redux": "^8.0.5", "react-router-dom": "^6.4.4", "react-scripts": "5.0.1", diff --git a/client/src/pages/book/Book.view.jsx b/client/src/pages/book/Book.view.jsx new file mode 100644 index 0000000..f211825 --- /dev/null +++ b/client/src/pages/book/Book.view.jsx @@ -0,0 +1,37 @@ +import React, { useState } from 'react'; +import { Document, Page } from 'react-pdf'; +import axios from '../../utils/axiosInstance'; + +const BookView = () => { + const [numPages, setNumPages] = useState(null); + const [pageNumber, setPageNumber] = useState(1); + const [file,setFile] = useState(null); + + const getBook = async()=>{ + const data = { + ipfsLink:"https://ipfs.moralis.io:2053/ipfs/Qmb7axp3nYTctZjpiLX1wkXdoaHXu7iNQAVZdQuJNoHXj5/uploads/sample.pdf" + } + const res = await axios.post('book/get',data) + // setFile(res.data) + setFile(res.data.buffer.data) + console.log(res) + } + + function onDocumentLoadSuccess({ numPages }) { + setNumPages(numPages); + } + return ( + <> + + + +

+ Page {pageNumber} of {numPages} +

+ + + + ) +} + +export default BookView \ No newline at end of file diff --git a/client/src/pages/book/sample.pdf b/client/src/pages/book/sample.pdf new file mode 100644 index 0000000000000000000000000000000000000000..dbf091df9a607221e000593a8b5a97b5ea5fb073 GIT binary patch literal 3028 zcmd5;+iK%D7``|79sZj_3mw^3d>n>>rft|$r=<Gl zWIx$CH11?D%do5oLHZ^AN9p^&qnnG-8;=ca>*%k)|M=6kY|A5;iigj(_3oW*IpgQ0 zB;?N?G}O?F~e-o&fdSbEveGxxNVs&T}_+wIC);wN|S3_`=^Ym z?y1Je_6W!5=Pa%0o_u4M!sh=IbybO>E+wq5{dR6;Rn+AKku*_{3aqswkCH}v ztJ}FLi^-kT6dU1Mb|uqH42vhacOeZu&Rl#HCGFr-xBWM-|+e^~95C3kuyCa8Nz&=d3 zPw9GoO7mhx4-J@*eqI7o0NLmbm9D2#M#EZ@Dl~~|vk9Y>(382@*~jiaPA^4vloGW^${BO z&|L0&$FyZ34q1)S0TXjiAeyzye;HJqPhX+oj`M@hIuz@m%ZWTgO?gR!qsqvQPqV zVBwTl{djT$Lm)?KJ&`!^p- zB?yU29^x`|s{JSof_pN9Oqel#YyZFw~B0kRS*9GB0?&&kJAg z<34|7m-_(#cV8b5!0fg%+X9aQc`Db0`!4$;o1mTB0`JJMabTnKqnZ}rgzd~^$`C_Q S>NZV0@_bPEqs!}&ZT$n`rwj1_ literal 0 HcmV?d00001 diff --git a/client/src/routes/routes.index.js b/client/src/routes/routes.index.js index f1875c0..a5b1c69 100644 --- a/client/src/routes/routes.index.js +++ b/client/src/routes/routes.index.js @@ -47,6 +47,10 @@ export default function Router() { path: "books/:id", element: , }, + { + path:"bookView/:bookID", + element: + } ], }, { @@ -88,3 +92,7 @@ const VerifyOTP = Loadable( const SingleBook = Loadable( lazy(() => import("../pages/book/SingleBook.component")) ); + +const BookView = Loadable( + lazy(() => import("../pages/book/Book.view")) +); \ No newline at end of file diff --git a/client/yarn.lock b/client/yarn.lock index ee06e96..5804aec 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -1033,7 +1033,7 @@ core-js-pure "^3.25.1" regenerator-runtime "^0.13.11" -"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.20.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.20.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.20.6" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.6.tgz" integrity sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA== @@ -4162,6 +4162,11 @@ domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.3.1: dependencies: domelementtype "^2.2.0" +dommatrix@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/dommatrix/-/dommatrix-1.0.3.tgz" + integrity sha512-l32Xp/TLgWb8ReqbVJAFIvXmY7go4nTxxlWiAFyhoQw9RKEOHBZNnyGvJWqDVSPmq3Y9HlM4npqF/T6VMOXhww== + domutils@^1.7.0: version "1.7.0" resolved "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz" @@ -4801,7 +4806,7 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" -file-loader@^6.2.0: +file-loader@^6.0.0, file-loader@^6.2.0: version "6.2.0" resolved "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz" integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw== @@ -6629,6 +6634,11 @@ magic-string@^0.25.0, magic-string@^0.25.7: dependencies: sourcemap-codec "^1.4.8" +make-cancellable-promise@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/make-cancellable-promise/-/make-cancellable-promise-1.1.0.tgz" + integrity sha512-X5Opjm2xcZsOLuJ+Bnhb4t5yfu4ehlA3OKEYLtqUchgVzL/QaqW373ZUVxVHKwvJ38cmYuR4rAHD2yUvAIkTPA== + make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz" @@ -6636,6 +6646,11 @@ make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: dependencies: semver "^6.0.0" +make-event-props@^1.1.0: + version "1.3.0" + resolved "https://registry.npmjs.org/make-event-props/-/make-event-props-1.3.0.tgz" + integrity sha512-oWiDZMcVB1/A487251hEWza1xzgCzl6MXxe9aF24l5Bt9N9UEbqTqKumEfuuLhmlhRZYnc+suVvW4vUs8bwO7Q== + makeerror@1.0.12: version "1.0.12" resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz" @@ -6670,6 +6685,11 @@ merge-descriptors@1.0.1: resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz" integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== +merge-refs@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/merge-refs/-/merge-refs-1.0.0.tgz" + integrity sha512-WZ4S5wqD9FCR9hxkLgvcHJCBxzXzy3VVE6p8W2OzxRzB+hLRlcadGE2bW9xp2KSzk10rvp4y+pwwKO6JQVguMg== + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" @@ -7163,6 +7183,14 @@ path-type@^4.0.0: resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pdfjs-dist@2.16.105: + version "2.16.105" + resolved "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.16.105.tgz" + integrity sha512-J4dn41spsAwUxCpEoVf6GVoz908IAA3mYiLmNxg8J9kfRXc2jxpbUepcP0ocp0alVNLFthTAM8DZ1RaHh8sU0A== + dependencies: + dommatrix "^1.0.3" + web-streams-polyfill "^3.2.1" + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz" @@ -8010,6 +8038,21 @@ react-lottie@^1.2.3: babel-runtime "^6.26.0" lottie-web "^5.1.3" +react-pdf@^6.2.0: + version "6.2.0" + resolved "https://registry.npmjs.org/react-pdf/-/react-pdf-6.2.0.tgz" + integrity sha512-FKUoUKKxoIipIbRHzXQZui1j+f1QcEuFuVL03qI1GFDm0jC4eUrMyOCpPR98lY7+rsCswPn1rjfKd+8k9PrZmQ== + dependencies: + "@babel/runtime" "^7.0.0" + clsx "^1.2.1" + make-cancellable-promise "^1.0.0" + make-event-props "^1.1.0" + merge-refs "^1.0.0" + pdfjs-dist "2.16.105" + prop-types "^15.6.2" + tiny-invariant "^1.0.0" + tiny-warning "^1.0.0" + "react-redux@^7.2.1 || ^8.0.2", react-redux@^8.0.5: version "8.0.5" resolved "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz" @@ -9111,6 +9154,16 @@ thunky@^1.0.2: resolved "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz" integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== +tiny-invariant@^1.0.0: + version "1.3.1" + resolved "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz" + integrity sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw== + +tiny-warning@^1.0.0: + version "1.0.3" + resolved "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz" + integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== + tmpl@1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz" @@ -9421,6 +9474,11 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" +web-streams-polyfill@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz" + integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== + web-vitals@^2.1.4: version "2.1.4" resolved "https://registry.npmjs.org/web-vitals/-/web-vitals-2.1.4.tgz" diff --git a/server/.DS_Store b/server/.DS_Store index 723deca813437f2c9bf2663458d32b30abdd974b..7441756caa326dd83dc994d92a7999781586dc16 100644 GIT binary patch delta 46 zcmZoMXfc@J&&aSP8{{^#bNuB80Hk{g1poj5 diff --git a/server/routes/book.routes.js b/server/routes/book.routes.js index 439fc45..6196c9b 100644 --- a/server/routes/book.routes.js +++ b/server/routes/book.routes.js @@ -9,7 +9,7 @@ import { } from '../controllers/book.controller.js' router.post('/upload',fileUpload.single('book'),fileUploadController); -router.get('/get',getBookFromIPFS); +router.post('/get',getBookFromIPFS); router.get('/getAll',getAllBooks) router.get('/get/:ID',getBookData)