How to publish an app

Just starting out? Need help? Post your questions and find answers here.
loulou2522
Posts: 51
Joined: Wed Mar 18, 2015 5:52 am

How to publish an app

Post by loulou2522 »

I am new with spiderbasic
Can someone explain me how to publish an app on a web site ?
Thanks in advance
munfraid
Posts: 104
Joined: Sat Mar 24, 2018 1:33 pm

Re: How to publish an app

Post by munfraid »

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.
User avatar
_aNdy_
Posts: 14
Joined: Fri Jul 15, 2022 4:56 pm
Contact:

Re: How to publish an app

Post by _aNdy_ »

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!
User avatar
Paul
Posts: 195
Joined: Wed Feb 26, 2014 6:46 pm
Location: Canada
Contact:

Re: How to publish an app

Post by Paul »

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\
User avatar
_aNdy_
Posts: 14
Joined: Fri Jul 15, 2022 4:56 pm
Contact:

Re: How to publish an app

Post by _aNdy_ »

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!
User avatar
Paul
Posts: 195
Joined: Wed Feb 26, 2014 6:46 pm
Location: Canada
Contact:

Re: How to publish an app

Post by Paul »

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?
User avatar
_aNdy_
Posts: 14
Joined: Fri Jul 15, 2022 4:56 pm
Contact:

Re: How to publish an app

Post by _aNdy_ »

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!
User avatar
Paul
Posts: 195
Joined: Wed Feb 26, 2014 6:46 pm
Location: Canada
Contact:

Re: How to publish an app

Post by Paul »

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.
User avatar
_aNdy_
Posts: 14
Joined: Fri Jul 15, 2022 4:56 pm
Contact:

Re: How to publish an app

Post by _aNdy_ »

Paul wrote: Sat Jul 16, 2022 12:46 am 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.
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.

Image
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: How to publish an app

Post by Peter »

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.
Post Reply