Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.34 KB

README.md

File metadata and controls

52 lines (40 loc) · 1.34 KB

Web API Server

Version: 3.20

Create Web API Server using B4X project template

Preview

Web API Server

For version 2.08, please check https://github.com/pyhoon/web-api-server-b4j/tree/v2.08

If you don't want to connect to any SQL database, see MinimaList API Server


Template:

  • Web API Server (3.20).b4xtemplate

Depends on:

Features:

  • Code simplified
  • Back to basics - use multiple Server Handlers
  • Improved API documentation
  • Built-in web front-end (bootstrap 4)

Code Example

Private Sub GetCategoryById (Id As Int)
	' #Desc = Read one Category by id
	' #Elements = [":id"]
	DB.Table = "tbl_categories"
	DB.Find(Id)
	If DB.Found Then
		HRM.ResponseCode = 200
		HRM.ResponseObject = DB.First
	Else
		HRM.ResponseCode = 404
		HRM.ResponseError = "Category not found"
	End If
	ReturnApiResponse
	DB.Close
End Sub

Support this project