[Project Template] Web API Server NEXT

aeric

Expert
Licensed User
Longtime User
What would you expect the next version to be?

Current concepts:
1. Lesser code (more simplified)
2. Back to basics, use multiple Server Handler
3. 1 Template, 1 B4xlib
4. More easier to generate CRUD REST API
5. Tutorial
 

aeric

Expert
Licensed User
Longtime User

aeric

Expert
Licensed User
Longtime User
With the current rewrite of project shao, it helped improve the new Web API Server.
Stay tune for version 3.10 for more improvements.
 

aeric

Expert
Licensed User
Longtime User
As version 3.10 released, I have also posted some detailed tutorials.

I hope to see some questions about this template.

I will be happy if more people use this template so to motivate me to further improve it.

Donation is very much welcome.

Many improvements are plan but I see very lack of interest.
 

aeric

Expert
Licensed User
Longtime User
Some ideas:
  1. Multiline body format
  2. Generate help without run debug
  3. Custom property or Override auto generated property (e.g method name doesn't need to start with Get)
 

aeric

Expert
Licensed User
Longtime User
Web API Server template version 4 is under development.
It will accept XML data in request body and return XML response format.

 

aeric

Expert
Licensed User
Longtime User
To clarify, there are no major changes in Web API Server v4 compared to v3.

What's new in v4:
  1. Some adjustments on the handling of XML format response in frontend and help page
  2. Demonstrate usage of VerboseMode in WebApiUtils v4 to replace SimpleResponse in WebApiUtils v3.
  3. Demonstrate support for XML format response in WebApiUtils v4
It also means this version will be continue to develop in the future.

For the time being, Web API Server v3 is the stable version if you only working with JSON format response.

In fact WebApiUtils v4 can also be use in Web API Server v3 with some migration steps.
v3:
' Main module
Private Sub Configurable
    conf.SimpleResponse.Enable = True
End Sub

' Initialize handler
Public Sub Initialize
    HRM.Initialize
    HRM.SimpleResponse = Main.conf.SimpleResponse
End Sub
similar to
v4:
' Main module
Private Sub Configurable
    conf.VerboseMode = False
End Sub

' Initialize handler
Public Sub Initialize
    HRM.Initialize
    HRM.VerboseMode = Main.conf.VerboseMode
End Sub
and vice versa.

 

aeric

Expert
Licensed User
Longtime User
So it is what you "wear" that make you look "smart".
Are you ready for the cat-walk?
 

aeric

Expert
Licensed User
Longtime User
More updated "good" news
 

aeric

Expert
Licensed User
Longtime User
Meanwhile, MiniORMUtils library has getting major bug fixes and improvement.
 

aeric

Expert
Licensed User
Longtime User
So far tested working very well for JSON but there are still some bugs for XML format need to be fixed especially in Verbose mode.

 

aeric

Expert
Licensed User
Longtime User
There is a Utility modul where it's primary use is to generate 3 javascript files during compilation for the front end and help page interactivity.

This modul is actually not required if you are not using the front end and help page.

For the past few weeks, for the sake of demonstrating the features of the new framework and WebApiUtils, I have taken so much time to refine the module to produce perfectly structure javascript so that it can be readable when using text editor.

I also tried to refactor, minimize the file size of the generated js files and simplified the code in Utility module.

It is a challenging task as I need to take consideration of all possible combination of server configuration and HttpResponseMessage properties.

The js files will be dynamically generated base on:
1. Content Type (XML or JSON)
2. Verbose (with or without the "smart" keys)
3. Ordered keys or non-ordered keys
4. Http verb (get, post, put, delete)
Note: Post verb can store access token if exist
5. Using custom alias names for "smart" keys
6. Custom XML keys for root and item
 

aeric

Expert
Licensed User
Longtime User
Advice from me, don't try to understand how my code works.
Unless you plan to contribute to the project which I highly welcome.

To use the template, run it once (by default) and then ask more questions.
 

Mashiane

Expert
Licensed User
Longtime User
Build a wizard, Mr Wizard.

Step 1: Select the DB... (SQLite / MySQL)
Step 2: Select the tables to produce an API for
Step 3: For each selected table, select the fields you want to use on the API.
Step 4: Generate the API code.
Step 5: b4x coder creates a project from your Web API Template
Step 6: Plug in your Wizard Generated Code
Step 7: Run your app.



PS: That way we won't have to learn and understand your code at all.. (Joking of course)
 

aeric

Expert
Licensed User
Longtime User
We both know such a tool not only existed in another multiverse.

I already built that as a single server handler that can transform the database table to REST API for CRUD operation.
Minimum coding is required.
 

aeric

Expert
Licensed User
Longtime User
Nice thing about that project is, it is more advanced, allows additional conditions, support asynchronize operations and optional checking on the required json object keys.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…