pakLebah / webCRT

A Pascal unit to make simple (CGI) web apps easy.
MIT License
15 stars 13 forks source link

how to load resulting app in browser please #2

Open JanuszChmiel opened 4 years ago

JanuszChmiel commented 4 years ago

Dear specialist,

I Am very nicely impressed thanks to yours simple but powerful series of Free Pascal unit to develop CGI apps for WEB browser. The simplicity is ideal for Me, since I do not see at all. But I do not know, how to load The resulting apps in browser? I always run ./pas.sh webdemo.pas -web But when I run resulting compiled binary appp, it do not display information how to load The data to The WEB browser. If I have understood it right, compiled Pascal app contain build in CGI little server which contain also CGI runable code of compiled Pascal WEB app. Any help will be very welcomed, since yours simple unit is ideal solution for my WEB apps needs as a visually impaired man.

Complex projects based on knowing Javascript language and specific Javascript classes is not for Me. I AM hoping, that you will have some time to answer on my question. With The warmest regards. Janusz Chmiel

pakLebah commented 4 years ago

Thank you for your appreciation. I never thought this Pascal unit will be used in serious projects since it's very simple and lacks of advance features for complex web applications. For example: sessions and cookies. Although adding such features is not too difficult, but it's beyond the purpose of this unit. If you could add those features, I'll be happy to receive your pull request.

I hope you have read the brief manual of how to use this unit, but it's in Indonesian. Because I made this unit to introduce web programming to beginners for my Indonesian Pascal community. The simplicity of this unit removes the impression that making web app using Pascal is hard and complicated. Fortunately, we got Google Translate so you can read the manual in any languages you prefer here.

I apologize for not informing how to deploy your compiled app onto the web server. I assumed the user of this unit already knows how to configure the web server. This unit compiled a program into CGI binary, so all you need to do is put the binary into the web server's CGI folder. If you're using Apache on Linux, the cgi-bin should be in /usr/lib/cgi-bin, then put the binary into it. Of course you could move it to any folder you like such as ~/web/cgi, only if you could configure your web server properly.

I hope my explanation helps. Feel free to ask me anything, I'll answer it as much as I could. Enjoy and have fun! 😊

~Mr Bee aka Pak Lebah

pakLebah commented 4 years ago

In case you want to know how to handle cookies and sessions, you may want to look at this another repo of mine here, especially the webUtils.pas file. It offers more features than webCRT unit but the usage is a bit more complex. The repo contains the code collection from my little ebook about the basic of web programming using Pascal. But it's also in Indonesian though I believe you could understand the code and the pictures/diagrams inside the book. And you could use Google Translate to understand the text.

Hope it helps.