This project aims for HTMX frontend with (fast)CGI backend written in Object Pascal using the FreePascal compiler and libs. It can also be compiled as a standalone server.
HTMX official website and docs
YOU MUST HAVE at least FreePascal compiler installed on your environment (and available in your path) and Python 3 (to use as local web server) in order to make this CGI + HTMX basic template/boilerplate to work.
- open the terminal inside VSCode
- on Windows compile/run with
.\scripts\buildDev.ps1
- on Linux or macOS compile/run with
./scripts/buildDev.sh
- access project on
http://localhost:3000
- check your browser to see if the project works
- CTRL+C on VScode terminal to stop the server
- htmx-tags
- OmniPascal - Open Preview
- access project on
dev
folder and upload to your server - please note that some servers have special paths for the cgi-bin folder
- if using as standalone server, set it up as you need (code is commented)
- you can make the CGI (or app) binary smaller by using FPC compiler options to suit your needs
- In order to start the local webserver called by the dev script, you must have Python3 installed on your machine
If you're talking about Pas2JS in the backend as a NodeJS/Bun app, yes. Any backend that receives requests and outputs HTML can be used.
Besides being possible, using HTMX usually means using less JavaScript, so mixing Pas2JS (Pascal transpiled to JavaScript) would go against it and can lead to unnecessary problems and added size. But all depends on what you need to do.