Nov 7, 2023 Replies: 2 Ola. Its amazing with the latest version of PocketBase one can extend it with JavaScript / Go. So I tested creating some REST API handlers. You can unzip the attached file to your pocketbase folder. It should create a pb_hooks folder. You can then call the handler via the browser after starting your server. It seems one can also do direct DB calls with this. A lot to be explored. This is the simple code on the created js file. Code: routerAdd("GET", "/api/hello/:name", (c) => { let name = c.pathParam("name") return c.json(200, { "message": "Hello " + name }) } Enjoy! Attachments pb_hooks.zip pb_hooks.zip 428 bytes · Views: 529 Click to expand...
Ola. Its amazing with the latest version of PocketBase one can extend it with JavaScript / Go. So I tested creating some REST API handlers. You can unzip the attached file to your pocketbase folder. It should create a pb_hooks folder. You can then call the handler via the browser after starting your server. It seems one can also do direct DB calls with this. A lot to be explored. This is the simple code on the created js file. Code: routerAdd("GET", "/api/hello/:name", (c) => { let name = c.pathParam("name") return c.json(200, { "message": "Hello " + name }) } Enjoy!
MichalK73 Well-Known Member Licensed User Longtime User Nov 21, 2023 #2 How to check authorization for a script using a previously generated token?
Mashiane Expert Licensed User Longtime User Nov 21, 2023 #3 MichalK73 said: How to check authorization for a script using a previously generated token? Click to expand... I am also learning this as I go along, perhaps the documentation can shed some light, I don't know yet.
MichalK73 said: How to check authorization for a script using a previously generated token? Click to expand... I am also learning this as I go along, perhaps the documentation can shed some light, I don't know yet.