Version: 1.16
A boilerplate for creating REST API Server with CRUD functionalities.
Check the Wiki! https://github.com/pyhoon/webapi-b4j/wiki
B4X Client app: https://github.com/pyhoon/webapi-client-b4x
For newer version, see web-api-server-b4j (v2.08) https://github.com/pyhoon/web-api-server-b4j
- ByteConverter
- JavaObject
- jServer (note that version 1.12+ is based on jServer 4.0)
- Json
- jSQL
- CRUD based - RESTful-API style (GET, POST, PUT, DELETE)
- Front-end (HTML, CSS, JS, Bootstrap)
- Support MySQL and SQLite database (can be modified for MS SQL or SQL Express)
- Separate SQL queries file (queries-mysql.ini and queries-sqlite.ini)
- Sample database auto-generated for first run (Category and Product tables with dummy data)
- Versioning (using ROOT_PATH in config.ini, set as "/" if you don't want versioning)
- Auto generated documentation with API test.
- Archive the files inside "Web API" directory as "Web API Server (1.16).zip" using WinRAR or 7-Zip
- Rename the extension from .zip to .b4xtemplate
- Download "Web.API.Server.1.16.b4xtemplate" from Release (https://github.com/pyhoon/webapi-b4j/releases). Rename it to "Web API Server (1.16).b4xtemplate".
- Copy the "Web API Server (1.16).b4xtemplate" file into B4J Additional Libraries folder.
- Open B4J and create a new project with "Web API" template. Give the project a name, for e.g. WebAPI
- Run the project in Debug or Release mode. You will see something like this in the Logs:
Web API Server (version = 1.16) is running on port 19800
Open the following URL from your web browser
http://127.0.0.1:19800/v1/
- Copy the URL showed in Logs and open it using your web browser.
- To connect to MySQL server, go to Objects folder and open "config.ini".
- Edit the root password at line #42 (second last line). Save the file.
- In B4J project, comment the line '#AdditionalJar: sqlite-jdbc-3.39.3.0 and uncomment the line #AdditionalJar: mysql-connector-java-5.1.49-bin. (Make sure you are using the correct version of connector)
- Follow step #4 to #5 above.
YouTube
Made with ❤ in B4X
Download and Develop with B4J for FREE: https://www.b4x.com/b4j.html