[Gambas-user] WebPage and external files

Bruce Steers bsteers4 at gmail.com
Sun Nov 13 16:23:26 CET 2022


On Sun, 13 Nov 2022 at 13:16, Hans Lehmann <hans at gambas-buch.de> wrote:

> Hello.
>
> For the Gambas book on gambas-buch.de I would like to provide some
> simple web projects based on the class `WebPage`.
> For this I want to use the internal HTTP server - either in the IDE or
> in the console (**) with
>
> (1)
> Console:    hans at pc-mint20:~/CGI/wp_example1$ GB_HTTPD_PORT=8080 gbx3 -H
> (2)
> URL:        http://localhost:8080/
>
> Reason: Not everyone wants to install and configure an HTTP server like
> Lighttpd or Apache2 for first tests.
>
> For CSS I use Inline-CSS and for JavaSript Inline-JS, but this makes the
> source code difficult to read.
>

So don't then ;)

However, I am unable to integrate multimedia objects such as images,
> favicons, audio files or video files.
>
> Question:
> When using the internal HTTP server in the IDE or via the console as in
> (**), is it possible to include the content of external files (CSS,
> JavaScript, multimedia objects)? If `Yes`, then I would like to know how
> this can be realised.
>
> With kind regards
>
> Hans
>

How exactly do you mean "external" ?
Files on your computer that are not part of the project or URLs?

I would say only if they are online.
(I do no know this for concrete fact, but this is as i understand things)

You should be able to use online URLs,
URLs of online resources should be reachable (if the computer is online)
but not anything on your local machine external to your project as the
server will not be configured to see your computers files in any way except
for the currently running project files.

Running the internal server is like letting gambas do the "install and
configure" a server for you and It does nothing at all fancy in any way.
it's a minimum requirement server to run the current project only.

I find using the .public folder is a good place to put things your project
will be able to see.
Pretty sure gambas internal server can use the .public folder.

For your examples for your book entries you should try to use online URLs
to the resources or provide them with the source project.

I think ultimately if you are going to write web projects then configuring
apache or lighttpd is a bridge you must cross pretty early on.


BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221113/c824aa2e/attachment.htm>


More information about the User mailing list