Skip to content

pyhoon/pakai-server-b4j

Repository files navigation

Pakai - Web API Server framework

Version: 5.00

Create REST API Backend using B4J project template

Preview

Index Edit Documentation

Template:

  • Pakai Server (5.00).b4xtemplate

Depends on:

Features:

  • Use Server Handlers
  • Improved API documentation
  • Built-in web front-end with CRUD examples
  • Supports JSON and XML formats payload and response

What's New

  • More cleaner code in Main module
  • More control to allowed http methods
  • Build-in CORS
  • Optional config file

Code Example

Sub AppStart (Args() As String)
	app.Initialize
	app.api.VerboseMode = True
	app.api.OrderedKeys = True
	app.Get("", "IndexWebHandler")
	app.Get("/api/products", "ProductsApiHandler")
	app.Get("/api/products/*", "ProductsApiHandler")
	app.Post("/api/products", "ProductsApiHandler")
	app.Put("/api/products/*", "ProductsApiHandler")
	app.Delete("/api/products/*", "ProductsApiHandler")
	app.UseConfigFile = True
	app.Start
	StartMessageLoop
End Sub

Support this project