Host using GitLab Pages
You may prefer to use GitLab Pages to host your project instead of using GitHub Pages. The process is mostly similar but enabling the serving of your scripts through the GitLab pages web server requires the addition of a new file called
We will use the GitLab user interface to create the
Log into your GitLab account and create a New Project/Repository. Then select the Create Blank Project option. Use any name for your project that you would like. GitLab will ignore any invalid characters for your projects final URL automatically as you type.
Upload the required files from your
bundle,jsand any other assets such as any images or 3D models needed by your project.
If your assets, such as any 3D models or images should also be placed in a sub folder, then you can edit the file name using the GitLab user interface, prepend the required folder name and follow it with a
/in front of the existing file name and then press the Commit Changes button. See video for example.
Go back to the root of your project, and create a new file, and select
gitlab-ci.yml, then Apply Template and then find and choose the
HTMLtemplate is already correctly configured to serve static files, so you can press the Commit Changes button right away.
Go to Settings/Pages and press the Save Changes button. You should then be presented with the URL of your projects GitLab page.
This is a very simple and minimal approach to hosting your Three.js examples for free as long as they can be fully downloaded as static files and don't require any bespoke or dynamic server side functionality or interaction.
GitLab Pages is acting just like a static HTTP web server but using a GitLab web address and an SSL certificate.