I am new with spiderbasic
Can someone explain me how to publish an app on a web site ?
Thanks in advance
How to publish an app
Re: How to publish an app
That's not difficult.
- Create a destination folder on your computer.
- Export your Web App to your destination folder as described in the manual.
- Make sure to set the checkmark "Copy SpiderBasic libraries"
- Upload the entire content of the destination folder to your web server
- done!
Your web app is now available under https//yourdomain.com/yourfolder/html-filename.
If you specify "index.html" as the "HTML filename", the adress will be simply https//yourdomain.com/yourfolder.
- Create a destination folder on your computer.
- Export your Web App to your destination folder as described in the manual.
- Make sure to set the checkmark "Copy SpiderBasic libraries"
- Upload the entire content of the destination folder to your web server
- done!
Your web app is now available under https//yourdomain.com/yourfolder/html-filename.
If you specify "index.html" as the "HTML filename", the adress will be simply https//yourdomain.com/yourfolder.
Re: How to publish an app
Help!
I'm teaching my 8 year old Grandson to code using PureBasic and he's come up with a simple game that should 'port' over to SpiderBasic (v2.31) quite easily. I want to do the port for him so the game will run in a web browser and he can show his friends in school.
I'm testing out the export options of SpiderBasic using the examples provided (I'm using the sprite demo) but cannot get the test file to export using 'Create App > Web'. I following the instructions in the manual the best I can and have searched this forum (including looking at the advice in the post above) but no luck!
Checking the 'Copy SpiderBasic libraries' options doesn't copy the libraries.
Providing the Resource directory name gets an error of... 'Resources directory copy failed (file path here)'
What am I doing wrong? Apologies for being stupid!
I'm teaching my 8 year old Grandson to code using PureBasic and he's come up with a simple game that should 'port' over to SpiderBasic (v2.31) quite easily. I want to do the port for him so the game will run in a web browser and he can show his friends in school.
I'm testing out the export options of SpiderBasic using the examples provided (I'm using the sprite demo) but cannot get the test file to export using 'Create App > Web'. I following the instructions in the manual the best I can and have searched this forum (including looking at the advice in the post above) but no luck!
Checking the 'Copy SpiderBasic libraries' options doesn't copy the libraries.
Providing the Resource directory name gets an error of... 'Resources directory copy failed (file path here)'
What am I doing wrong? Apologies for being stupid!
Re: How to publish an app
Easiest way is to export to your PC then upload to Web Server, so create a folder on your C: drive called
C:\Web
From the MenuBar under "Compiler/Create App.." under the "Web" tab...
App Name: MyApp
Icon: favicon.png
HTML filename: C:\Web\index.html
JavaScript filename: MyApp.js
SpiderBasic libraries path: sbresources
O Resource directory:
X Copy SpiderBasic libraries
O Enable debugger
---------------------------
(X=checked / O=unchecked)
Press "Create App".
Then upload the "C:\Web" folder to your web server.
=====================
Note: If you have extra resources (image files/sound file/ext.) make sure you app accesses these files from a single sub folder from your main folder. For example if your main app is in "C:\My Software\MyApp" have all your resource files in "C:\My Software\MyApp\Extras"
Then when you "Create App" add this line for all resources to be copied...
X Resource directory: Extras\
C:\Web
From the MenuBar under "Compiler/Create App.." under the "Web" tab...
App Name: MyApp
Icon: favicon.png
HTML filename: C:\Web\index.html
JavaScript filename: MyApp.js
SpiderBasic libraries path: sbresources
O Resource directory:
X Copy SpiderBasic libraries
O Enable debugger
---------------------------
(X=checked / O=unchecked)
Press "Create App".
Then upload the "C:\Web" folder to your web server.
=====================
Note: If you have extra resources (image files/sound file/ext.) make sure you app accesses these files from a single sub folder from your main folder. For example if your main app is in "C:\My Software\MyApp" have all your resource files in "C:\My Software\MyApp\Extras"
Then when you "Create App" add this line for all resources to be copied...
X Resource directory: Extras\
Re: How to publish an app
Wow! Thanks for the quick response! Some fantastic, clear instructions there that have cleared up some issues for me!
However, still encountering 2 issues...
1) When running the html file in the 'web' folder on c: locally, the needed png file in the 'data' folder doesn't get loaded.
2) When uploading to some webspace to test anyway, I'm getting a message saying my browser is too old to run SB programs! I'm running the latest versions of both Firefox and Chrome!
Sorry, I'm obviously still being stupid!
However, still encountering 2 issues...
1) When running the html file in the 'web' folder on c: locally, the needed png file in the 'data' folder doesn't get loaded.
2) When uploading to some webspace to test anyway, I'm getting a message saying my browser is too old to run SB programs! I'm running the latest versions of both Firefox and Chrome!
Sorry, I'm obviously still being stupid!
Re: How to publish an app
Without seeing some code it's hard to even guess what the problem might be.
When you load your png file, is your code something like
LoadSprite(1,"data/myimage.png")
And do you have the proper BindEvent and Procedure to load the images?
When you load your png file, is your code something like
LoadSprite(1,"data/myimage.png")
And do you have the proper BindEvent and Procedure to load the images?
Re: How to publish an app
Thanks for your further reply and patience!
I'm only conducting tests at present so I'm only using the code provided with SB in examples folder for 'sprites'. The only change I've made is the file location for the 'spider.png' image.
This is a brand new SB install with everything left as default in the installer.
I'm confused!
I'm only conducting tests at present so I'm only using the code provided with SB in examples folder for 'sprites'. The only change I've made is the file location for the 'spider.png' image.
This is a brand new SB install with everything left as default in the installer.
I'm confused!
Re: How to publish an app
Once you've exported your web data using "Create App", it must be uploaded to the web server to test it.
It will not run locally.
It works when testing through the IDE because the IDE creates a web server in the background that it runs through.
It will not run locally.
It works when testing through the IDE because the IDE creates a web server in the background that it runs through.
Re: How to publish an app
Ah ok! Explains the local problem.
I have some free webspace and when uploading to it and testing, I'm getting the following error. As mentioned previously, I'm running up-to-date versions of Firefox and Chrome.
Re: How to publish an app
Your browser is OK. I get the same message.
The reason why this message comes up is that a file called "platform.js" is missing in your WebApp. This contains a function that tests whether your browser meets the requirements.
Normally, this file is always copied. I don't see any reason why it should be missing. I have never had problems with it.
Maybe you should reinstall SpiderBasic completely and make sure that "Copy SpiderBasic libraries" is ticked. Also make sure that you copy all files in the output folder to your web space.
The reason why this message comes up is that a file called "platform.js" is missing in your WebApp. This contains a function that tests whether your browser meets the requirements.
Normally, this file is always copied. I don't see any reason why it should be missing. I have never had problems with it.
Maybe you should reinstall SpiderBasic completely and make sure that "Copy SpiderBasic libraries" is ticked. Also make sure that you copy all files in the output folder to your web space.