GithubHelp home page GithubHelp logo

pyhoon / webapi-b4j Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 3.0 1.71 MB

A boilerplate for creating CRUD based Web API.

Home Page: https://www.b4x.com/android/forum/threads/web-api-template.133764/

License: Creative Commons Zero v1.0 Universal

HTML 30.08% JavaScript 25.19% Batchfile 0.40% Visual Basic 6.0 33.71% VBA 10.61%
mysql sqlite webapi restful-api crud-api b4x b4a b4i b4j ajax-request

webapi-b4j's Introduction

WebAPI-B4J

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 webapi-2-b4j (v2.01) https://github.com/pyhoon/webapi-2-b4j

Depends on following libraries:

  • ByteConverter
  • JavaObject
  • jServer (note that version 1.12+ is based on jServer 4.0)
  • Json
  • jSQL

Features

  • 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.

Create B4X template from source

  1. Archive the files inside "Web API" directory as "Web API Server (1.16).zip" using WinRAR or 7-Zip
  2. Rename the extension from .zip to .b4xtemplate

How to use

  1. 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".
  2. Copy the "Web API Server (1.16).b4xtemplate" file into B4J Additional Libraries folder.
  3. Open B4J and create a new project with "Web API" template. Give the project a name, for e.g. WebAPI
  4. 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/
  1. Copy the URL showed in Logs and open it using your web browser.
  2. To connect to MySQL server, go to Objects folder and open "config.ini".
  3. Edit the root password at line #42 (second last line). Save the file.
  4. 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)
  5. Follow step #4 to #5 above.

Preview

YouTube

Alt text

Made with โค in B4X

Download and Develop with B4J for FREE: https://www.b4x.com/b4j.html

webapi-b4j's People

Contributors

pyhoon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.