Share My Creation [Project Template] Web API Server 2

aeric

Expert
Licensed User
Longtime User
Web API Server
version: 2.06

What's New
(new) WebApiUtils v2.06
(new) MiniORMUtils v1.10
(new) WebAPIController v1.05
(new) Main module is cleaner
(new) Added ServerConfiguration class
(new) Added DatabaseConfiguration class
(new) Added empty index.html files into assets folders
(new) FindController - case insensitive and wildcard search
(change) Table tbl_category renamed to tbl_categories
(change) ServerConfiguration Update sub renamed to Finalize
(change) better handling of default values in config.ini
(fix) bug in v2.06 beta 1, no database set by default in config.ini
(fix) bug in v2.06 beta 2, PostProduct line#233 in ProductsController causing all data inserted as Timestamp
 

aeric

Expert
Licensed User
Longtime User
Web API Server
version: 2.07

What's New
  • (new) WebApiUtils v2.07
  • (new) MiniORMUtils v1.11
  • (new) WebAPIController v1.06
  • (new) Main module
    • SHOW_API_ICON to control API icon visible on frontend top navbar
  • (new) ServerConfiguration class
    • setEnableHelp to disable API Documentation and icon in frontend top navbar
    • setSimpleResponse replaces 3 old variables
  • (change) ServerConfiguration class
    • rename some variables
    • change some Public subs to Private
  • (change) Some index.html files deleted
For more details, check GitHub changes
 

AHilton

Active Member
Licensed User
Longtime User
I'm just now looking into this and have added the Optional Filters: BasicAuthFilter.bas and JWTAuthFilter.bas. They have a dependency on a Utility module but I can't find it.
 

AHilton

Active Member
Licensed User
Longtime User
Then what is the equivalent of Utility.RequestBasicAuth(Auths) in WebApiUtils (v2.07) ? I'm not seeing it and there are no Sub comments in WebApiUtils.
 

aeric

Expert
Licensed User
Longtime User
Then what is the equivalent of Utility.RequestBasicAuth(Auths) in WebApiUtils (v2.07) ? I'm not seeing it and there are no Sub comments in WebApiUtils.
It has been commented.

You can modify WebApiUtils.bas inside the b4xlib. It will depends on StringUtils.

Take note that once authenticated in Web browser, the session is difficult to unauthenticate.

It is not suitable for Web app but can be use for mobile or desktop clients.
 

aeric

Expert
Licensed User
Longtime User
Web API Server
version: 2.08

What's New
  • (new) WebApiUtils v2.08
  • (new) MiniORMUtils v1.13
  • (new) WebAPIController v1.07
  • (change) Use DbFile instead of DbName for SQLite in config.ini
  • (change) Move code from ConfigureDatabase sub to Initialize sub in DatabaseConfiguration class
  • (remove) Delete build configurations and code for Firebird, PostgreSQL and MS SQL
Updates:
RequestBasicAuth(Auths) is now available in WebApiUtils (v2.08)
 
Last edited:

aeric

Expert
Licensed User
Longtime User
Optional Modules
  1. JSON Web Tokens
  2. Encryption

Optional Filters​

  1. BasicAuth
  2. JWTAuth
Updates: These modules have been deprecated. They are no longer working without modifications. If you want to work with these modules, please post to a new thread.

If anyone need these classes and filters, I will update them in the future when I find time.

You can also check [Project Template] User Login Server which implements API Key + Access Token.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…