Hello guys,
I'm looking at how to get PB to become a HTTP Rest API endpoint but not sure where to start. I've seen the CGI module but that is kind of one endpoint and using variables like abc.net/cgi-bin/app?action=abc and then run procedures based on that.
Looking to build a backend for my SpiderBasic app.
Or maybe a websocket is better to do? Please advise your experience?
PB app as a HTTP Rest API
Re: PB app as a HTTP Rest API
With a REST-API endpoint you mean a web server which reponds to your JSON requests.
So you need to implement a server which listens to port 80 (or whatever) and handle the incoming packets.
So you need to implement a server which listens to port 80 (or whatever) and handle the incoming packets.
Re: PB app as a HTTP Rest API
If your application uses SpiderBasic, then there is already a web server. So you have to use the CGI system.
It is the equivalent of a console application, except that the standard output is the Web page and not the console.
Nothing special to do, except format the output (web page ? json ? xml ? text ?)
It is the equivalent of a console application, except that the standard output is the Web page and not the console.
Nothing special to do, except format the output (web page ? json ? xml ? text ?)
Re: PB app as a HTTP Rest API
You can use Websocket (available in the new SpiderBasic 2.40 version) and for the server, using this module: https://github.com/Dadido3/WebSocket_Server. It should be easy to do an fast.
Re: PB app as a HTTP Rest API
Hi Fred,
Very interested in v2.40 as I'm interested in Android apps.
And you say...
Very interested in v2.40 as I'm interested in Android apps.
And you say...
beta 4 is out, it includes AAB (Android App Bundle) package creation and some fixes to be able to publish on Google Play. I tried it and it works as expected. An AAB package will be now automatically generated when creating an Android app which is not in debug mode. Feel free to test it to see if it works as expected !
- It was too lonely at the top.
System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem