B4J Library [Web] [Server] EndsMeet v1.10

Attachments

  • EndsMeet.b4xlib
    4 KB · Views: 53
Last edited:

aeric

Expert
Licensed User
Longtime User
Version: 0.96
  1. New routes list property
  2. New methods
    1. Get
    2. Post
    3. Put
    4. Delete
    5. HandlerAdded (private)
    6. MethodAvailable
    7. MethodAvailable2
    8. CreateRoute
 

netsistemas

Active Member
Licensed User
Longtime User
Forgive my ignorance, but:
How can I test this project?
I've downloaded and run it (previoous intall: WebApiUtils and MiniHtml librarys), but I'm experiencing errors.
I understand it's a mini-web server.

Does it support PHP, or can you tell me a simple use case?

What do I need to know, learn, or read to use it?
thanks
 

aeric

Expert
Licensed User
Longtime User
Hi @netsistemas,
Thanks for your interest on this library.

How can I test this project?
You can download this template to start.
https://www.b4x.com/android/forum/threads/project-template-endsmeet-server-v0-90.158071/

I've downloaded and run it (previoous intall: WebApiUtils and MiniHtml librarys), but I'm experiencing errors
What error do you get?

Does it support PHP
No, it is a B4J server (jetty).

can you tell me a simple use case?
You can create B4J server apps with this library.
Basically, I just add some functions to configure the B4J server.

Examples of B4J server I created includes
Support Ticketing system,
shao microblog,
cloud dashboard,
license activation server,
todo list server and
quiz app server.

While PHP is an interpreted language,
B4J server is a compiled app similar to languages like .NET or Java
but B4J is compiled as a single executable jar.

To create a web application, you can create the backend using B4J.
For frontend, you can either
1. create a REST API in JSON (or XML/SOAP) and consume by JavaScript
or
2. passing variables, usually as list or maps into some templating engine
such as Velocity, Freemarker, Thymeleaf.

What do I need to know, learn, or read to use it?
The latest tutorial I created is for Web API Server v3.
Web API Server v4 (renamed as Pakai framework) has no tutorial yet.

If you have questions on MiniORMUtils, WebApiUtils or MiniHtml libraries, please ask me.
 

aeric

Expert
Licensed User
Longtime User
I've downloaded and run it (previoous intall: WebApiUtils and MiniHtml librarys), but I'm experiencing errors.
I think the error you are talking about is on HttpsFilter.

If you get error:
HttpsFilter - 16: Unknown member: sslport

You can update the code from app.sslPort to app.ssl.Port at line #17.
This is a breaking changes since v0.93.
For your information this library is still in beta, so I am making a lot of changes.
Sometimes I updated the code on GitHub but didn't update here.

B4X:
'Https Filter class
Sub Class_Globals

End Sub

Public Sub Initialize
 
End Sub

'Return True to allow the request to proceed.
Public Sub Filter (req As ServletRequest, resp As ServletResponse) As Boolean
    If req.Secure Then
        Return True
    Else
        'Dim app As EndsMeet = Main.app
        resp.SendRedirect(req.FullRequestURI.Replace("http:", "https:") _
       .Replace(Main.app.Port, Main.app.ssl.Port))
        Return False
    End If
End Sub
 
Last edited:

aeric

Expert
Licensed User
Longtime User
Version: 1.00

What's New
  1. New routes list property
  2. New methods
    1. Get
    2. Post
    3. Put
    4. Delete
    5. RouteAdded
    6. MethodAvailable
    7. MethodAvailable2
    8. CreateRoute
  3. Removed
    1. Route
  4. Renamed
    1. HandlerAdded -> RouteAdded
    2. ShowLog -> LogStartupMessage
 

aeric

Expert
Licensed User
Longtime User
Version: 1.10

What's New
  1. Fix issue in ssl port redirect
 

Theera

Expert
Licensed User
Longtime User
Version: 1.10
GitHub: https://github.com/pyhoon/EndsMeet

Create a server app with 4 lines of code:
B4X:
Sub Process_Globals
    Public app As EndsMeet
End Sub

' <link>Open in browser|http://127.0.0.1:8080</link>
Sub AppStart (Args() As String)
    app.Initialize
    app.Get("", "Index")
    app.Start
    StartMessageLoop
End Sub

Project template: https://www.b4x.com/android/forum/threads/project-template-endsmeet-server-v1-00.158071/
Thank you,Aeric for sharing License contents ,I've just known the laws about MIT. Let me translate to be Thai. (I afraid me go to the jail again ,if I don't know this)
 

aeric

Expert
Licensed User
Longtime User
Thank you,Aeric for sharing License contents ,I've just known the laws about MIT.
Great.
Basically you don't need to worry about it.
You can do whatever you want with the source code but you must recognize the original work is created by the author by adding a licence file with his name when you share out your modified project.
In other words, give credit to the original author.
 

aeric

Expert
Licensed User
Longtime User
I thought renaming library file name including version number can keep different versions compatible with older apps but my library downloader app is not mature enough to handle it at this point so I decided to revert the idea back to library file name without including the version number.
It is a bad experiment.
Sorry for any inconvenience.
 

Theera

Expert
Licensed User
Longtime User
Where should I download it for test? I 've downloaded from some where ,it has error about unknown member.
 

aeric

Expert
Licensed User
Longtime User
Where should I download it for test? I 've downloaded from some where ,it has error about unknown member.
This is a B4J library.
It is better you use it with the project template from the link in first post.

This library also use in Pakai Server v5 project template
 
Top