Deploying GWA apps
This section describes how to build and deploy GWA apps with Genero.
Building GWA apps with Genero
Genero provides a command-line tool to create GWA.
Genero Web Applications are distributed as Genero archive (gwa) files, similar to standard Genero archive (gar) files. A GWA package can be deployed on a GAS to be served by a web server.
Genero provides the gwabuildtool command line tool to build GWA applications.
- The Genero BDL development environment (FGLDIR) must be installed to compile your program files.
- The GWA must be installed. For more details, go to Install Genero Web Application.
- Refer to the topics in the Overview section to quickly become familiar with the features of the GWA.
Program directory required for the build
To build a GWA application, you must prepare a directory, referred to as the programdir, containing the program files (.42m, .42f, and so on) and resource files (images, database files, web components) needed by the Genero Web application. This directory might have a structure similar to that described for mobile applications in Directory structure for GMA apps.
Specifying the GBC to be used
- The first option, is to use the GBC specified by the
gwabuildtool --gbc gbc-directory
build option. - If the
--gbc
option is not specified, gwabuildtool will look for the FGLGBCDIR environment variable. - Finally, it defaults to the FGLDIR/web_utilities/gbc/gbc directory if none of the previous options is set.
GBC is loaded in an iframe inside the GWA application, meaning the index.html of GWA is different from the index.html of GBC.
Any customization of the GBC is expected to work. GWA requires that GBCDIR/index.html exists and GBCDIR/VERSION exists.
debugmode
","contextmenu
","mobileui
",
"theme
" and so on – as you would with standard server applications. For example, to
load the GWA application in debug mode, start your application with gwarun. The URL may be something like
this:http://localhost:9103/d/r/index.html?fglapp=main.42m&uuid=gwarun2024_12_11_18_00_31_769&viaMiniWS=1
Add
&debugmode=1
at the end of the URL and reload the application. On reload, the
GBC debug icons should be visible in the chromebar at the top. For more information about GBC query
string options, refer to Query string parameters page in the Genero Browser Client User Guide.Specifying environment with fglprofile
If you provide a fglprofile file in your program directory, it will be bundled with your application package. For details of setting environment for your GWA application, go to Setting environment with fglprofile.
The Web manifest file
Every GWA application must be created with a web application manifest file. The gwabuildtool creates a default manifest file that can be modified later. For more details, go to Web application manifest file.
Specifying the start-up module
- In the URL query string, you can specify
fglapp=anothermodule
. GWA will then look in the embedded file system for a 42m of that name (for example, /app/anothermodule.42m) - Or with the gwabuildtool, you can use the option
--main-module
to specify the initial 42m module to be loaded.
Build and deploy the application
Build, deploy, and launch a GWA application on the GAS
It is assumed you have a directory with your Genero program files. For more information on creating the program directory, go to Program directory required for the build
Follow these steps to build the GWA application:
--gbc
option if the default GBC is not to be used. For more information, go to
Specifying the GBC to be used.gwabuildtool --program-dir /usr/myprogramdir
Deploy and launch the application
cd gwa_dist
gwasrv index.html
The default browser opens with an address like
http://localhost:9101/d/r/gwa_dist/index.html
and serves the Genero application now
running in the browser. To deploy the application on your GAS, you must first produce a Genero archive (gwa) file using fglgar gwa.
Steps
Change the favicon
This procedure shows you how to change the favicon image.
About this task
A favicon is an icon associated with a URL, displayed in various locations such as a browser's address bar, tab, or alongside the site name in a bookmark list. Figure 1 shows a GWA app displayed using the default favicon.

<link>
element, as shown in the following
example:<link rel="icon"
href=logo512.png.63839.eb1d062b9dc0e90a6f05a237c8a2e3c8.png
sizes="512x512"
type="image/png"/>
The favicon can be set with the "icons" property in the gwa/gwa.webmanifest
file, using the GWA-specific "GWA:linkRel
" attribute. This attribute's value
corresponds to the "rel" attribute in the <link>
element.
Steps to change the favicon
Build and test
After completing the task above, you may want to consider that the icon can also be turned off by
using the "GWA:removeFromManifest"
attribute. Setting this attribute to true will
omit the icon from the generated webmanifest file, resulting in the creation of only a
<link>
tag.
{ "_": "gwa.webmanifest file",
"icons": [
{ "_hint":"next icon appears only as a link and is removed from the resulting manifest"},
{ "src": "bug.png",
"type": "image/png",
"sizes": "690x690",
"purpose": "any",
"GWA:linkRel": "apple-touch-icon",
"GWA:removeFromManifest":true
}
]
}
Customize the index page
The GWA allows customization of index.html using custom CSS and HTML files.
index.html
file. You have two options for this customization:- Custom CSS file: Use a custom CSS file to modify the visual appearance and layout of HTML elements.
- Custom HTML template file: This option is only necessary if customizing the CSS is not
sufficient, meaning you explicitly want to add elements to the existing
index_tpl.html
page located ingwa-install-dir/lib/gwa/index_tpl.html
. Note that while this customization allows for greater flexibility, it can be more susceptible to being broken by future updates, so it should be used cautiously.
By choosing either option, you can effectively tailor the user experience to your requirements.
Customize CSS
- Create a custom CSS file. The custom CSS file must be named
gwa_custom.css
and placed in your programdir/gwa directory. - Update the
gwa_custom.css
file. For most visual changes—such as colors, fonts, spacing, and button styles—CSS is the ideal place to make modifications. For example, you can alter the visual appearance and layout of HTML elements on the index page by defining or creating CSS classes.<!-- GWA custom css injection --> body {background-color: green}
Customize index_tpl.html
- Create a custom index_tpl.html by copying the default template from the GWA installation directory (gwa-install-dir/lib/gwa/index_tpl.html) to your program directory (programdir/gwa) .
- Update the
index_tpl.html
file. If you need to change the structure of the page—such as adding or removing elements, changing layout containers, or adding a logo—you may need to edit the template itself. In this case, using the custom CSS may be unnecessary, as you can directly include the CSS within the page. However, you still have the option to use thegwa_custom.css
file, which will be injected using the<!-- GWA custom css injection -->
placeholder.Important:If a custom HTML file exists at programdir/gwa/index_tpl.html, it will be used as the template instead of the default one. Therefore, when modifying the index_tpl.html file, ensure that all templating comments remain intact. Specifically, do not alter the injection points indicated by comments such as:
<!-- GWA favicons injection -->
<!-- GWA manifest injection -->
<!-- GWA App Version injection -->
These comments mark the locations where the build tool adds essential content, including links to icons, manifest files, and version information.
Troubleshooting GWAs
What steps can you take if you have trouble with a Genero web application (GWA)?
If a GWA is stuck during the load process, check the browser debug console for errors.
The error is most likely visible in the console, either from the JavaScript side or from the fglrun side. fglrun VM runtime errors appear as alerts in the GBC UI like in any other Genero app.
If the error is not an fglrun runtime error:
- First, try reloading the app with the browser reload option with:
- "Force Reload this page"(Chrome).
- "Reload page from Origin" (Safari®).
- Ctrl-F5 (Firefox™).
- Next, clear the browser cache and then reload.
- Next, clear website data for the development host and reload.