Share My Creation [Web] [Project Template] Pakai Server v6.00beta

Pakai Server v6.00beta​

GitHub: https://github.com/pyhoon/pakai-server-b4j/tree/v6.00

Index
Project modules


Template:
  • Pakai Server (6.00beta3starter).b4xtemplate (28KB) recommended
  • Pakai Server (6.00beta3bundle).b4xtemplate (412KB)
  • Pakai Server (6.00beta3min).b4xtemplate (18KB)
Depends on:

Reminder: Please do not post issue or question on this thread.
Always remember to start a new thread for any question and prefix with [Pakai v6].
 

Attachments

  • Pakai Server (6.00beta3starter).b4xtemplate
    28 KB · Views: 0
  • Pakai Server (6.00beta3bundle).b4xtemplate
    412.8 KB · Views: 0
  • Pakai Server (6.00beta3min).b4xtemplate
    17.5 KB · Views: 0
Last edited:

aeric

Expert
Licensed User
Longtime User

AppStart​

AppStart:
Sub AppStart (Args() As String)
    App.Initialize
    App.LoadConfig
    
    ' *** Web handlers ***
    App.Get("", "ProductsHandler")
    App.Get("/categories", "CategoriesHandler")
    
    ' *** Api handlers ***
    App.Rest("/api/products/*", "ProductsHandler")
    App.Rest("/api/categories/*", "CategoriesHandler")
    
    App.Start

    DB.Initialize
    DB.ConnectDatabase
    StartMessageLoop
End Sub
 

aeric

Expert
Licensed User
Longtime User
Updated to v6.00beta3min

This template removed assets files in Objects\www folder to make it only 18KB in size
Download the following jar files and put inside B4X additional libraries folder.

The project will show broken image links and some JavasScript and CSS are not working correctly.
You need to run GetResources macro to download the assets files.
https://github.com/pyhoon/resget-b4j/releases/download/v1.00/resget.jar

This template requires updated version of dependencies.
You need to run GetLibraries macro to download the updated version.
Refresh the libraries manager tab after download is completed.
https://github.com/pyhoon/libget-b4j/releases/download/v2.50/libget.jar

If the project is showing error missing libraries, run GetLibraries macro to download the libraries.
Close and relaunch the project.



Edit:
In full version I may provide additional bundled version of this template.
First post has been updated with 3 versions.
By default, please use the starter version.
  • Pakai Server (6.00beta3starter).b4xtemplate (28KB) recommended
  • Pakai Server (6.00beta3bundle).b4xtemplate (412KB)
  • Pakai Server (6.00beta3min).b4xtemplate (18KB)
If you use the bundle version template, you can select "Bundle" from the Conditional Compilation so the html generated will use the local asset files instead of from jsdelivr CDN.

MainView:
#If Bundle
body1.script("$SERVER_URL$/assets/js/bootstrap.min.js")
body1.script("$SERVER_URL$/assets/js/htmx.min.js")
#Else
body1.cdnScript("https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.min.js", _
"sha384-G/EV+4j2dNv+tEPo3++6LCgdCROaejBqfUeNjuKAiuXbjrxilcCdDz6ZAVfHWe1Y")
body1.cdnScript("https://cdn.jsdelivr.net/npm/htmx.org@2.0.8/dist/htmx.min.js", _
"sha384-/TgkGk7p307TH7EXJDuUlgG3Ce1UVolAOFopFekQkkXihi5u/6OCvVKyz1W+idaz")
#End If
 
Last edited:
Top