Is there anything equivalent to middleware in Openresty or Lua web apps? - openresty

I'm learning Openresty for a small web app. Is there an abstraction layer Lua web apps and frameworks? For example: Python/WSGI, Ruby/Rack, Elixir/Plug.
The most recent one I found for Lua seems out-of-date: APItools/lua-resty-rack
There is also WSAPI and WSAPI-Openresty, but I couldn't find any maintained middleware/projects that utilize it.
Do Openresty apps simply not use this type of abstraction layer for most production apps? Or is it not needed because of the Openresty architecture?

Related

How is express.js considered a Middleware framework?

I'm trying to understanding how Middleware in express.js applications and Middleware in general are related.
As a standalone term, it is mostly referred to as something that acts as a central abstraction layer between applications and more fundamental technologies. In an express.js or web context, it is generally explained in a very different way.
According to Wikipedia,
Middleware is a type of computer software that provides services to
software applications beyond those available from the operating
system.
Which is very similar to the defintion of middleware in distributed applications.
Is the middleware used in express.js applications anything different, or just a very specific use case of this concept?
Also, is Middleware considered an architectural pattern?

Web development using Raku

I want to know if web development can be done using Raku or Perl6?
Like Django for Python, do we have any framework available for Raku?
Id appreciate if you told us which are the libraries available or any tutorial.
Are there any webhosting providers to host Raku web application?
Many folks are using Cro for this. It's a set of libraries that you can pick as needed (and not just for web development), but offers things like:
Routing requests to handlers, and neat ways to express those handlers
WebSocket support integrated neatly into the router
Templating
Testing
There's a simple tutorial as well as a much longer one on making a SPA.
There is also a fresh CRUD server-side tutorial available.
Finally, there's integrated support in the Comma IDE, which includes a Cro project template where you can select the bits you need, indexing of and navigation to routes, and a timeline view that can be used to understand where time is spent during request processing.
There are base images available to support Docker deployment also, to anywhere that supports that.
I built a web framework for Raku called Humming-Bird it's brand new so there are still kinks to work out, but the core works really well! It is intended to be very similar to Sinatra and other frameworks of that style (express.js etc..)
Humming-Bird has most of the typical features of a web framework including but not limited to:
Routing
Middleware
Serving static files
This project is still in fairly early stages, but it offers more than enough to spin up simple web services, and web apps.

Server Architecture .net/cocoa app

I'm planing on creating an native .net app for Windows as well as a native OSX application with swift.
These two applications should be able to communicate with the same server. With that I mean writing and reading from the same SQL Database, and have REST communication with the server.
Now I'm struggling to come up with a solution for the backend. I'm looking into Serverless backends like Azure or Google Cloud, but I'm not sure that I can use these Services with both my applications. Both Azure and Google Cloud have SDKs for .Net but I've never found one for Swift or Objective-C.
Are there such Services that allow me to communicate or should I just develop my own?
Do you have any good solutions for my problem? Or what is the best server architecture to use for this kind of problem? Any inputs are appreciated!
If your servers vend a REST API, no vendor SDKs should be required. REST is platform- and vendor-agnostic. All you need is an HTTP client, which Swift/ObjC most definitely do have. I use a serverless (AWS Lambda) setup from Swift, and it's easy. Though, I have done this kind of thing before :)
What I would do is setup a simple test server, and expose an API endpoint. Make sure you can reach it with curl from your machine. Then, take a look at the NSURLSession APIs in Foundation. They'll help you make an HTTP request similar to what curl can do. From there, you'll need to investigate serialization (like JSON), which Swift can also do easily (as of Swift 4, I believe).
Good luck!

Is MBaaS specifically for Hybrid applications or can also used for Native Applications?

I am researching MBaaS (Mobile Backend as a Service) and what its purpose is, for school. So far I gathered that it is basically a resource that developers can use so they can create the back-end code one time, rather than separately for each device - this way the focus can be more on the front-end of the development.
So my initial thoughts would be that this tool can be used only in the creation of Hybrid apps, however I'm having difficulty finding information to back that thought up. So can MBaaS be applied to Native apps also?
If the sense of meaning I've gathered about what MBaaS is used for is wrong, making my original question void or not applicable, a thorough but simple explanation, of what exactly MBaaS does would be very much appreciated.
MBaaS is a service that can be used by all – companies that are big to start ups and solo developers.
Mobile app development remains fun when it is about designing user interfaces, engineering social communication among users or bringing in stickiness. The Backend infrastructure plumbing is too time consuming and less rewarding. Worrying about database scaling, thread locking, persistence, user registration handling, messaging and pushing notifications is not fun. They are necessary evils that have to be taken care of to launch an app. The Baas paradigm has definitely made app development much easier and fun. Hence MBaaS services definitely present a powerful case for quick adoption.
Built.io Backend is an MBaaS provider. It is client platform agnostic. It provides platform-specific SDKs (iOS as well as Android) for native app development, and Xamarin and JavaScript SDKs for hybrid app development.
Coming back to your question. MBaaS can be used to develop native as well as hybrid applications. The services is not limited to a platform or any other technology.
PS: I am employee at built.io

API frameworks for node.js

Which API frameworks for node js best suits mobile applications (native or HTML5) or client-side HTML5?
While there are many frameworks (https://github.com/joyent/node/wiki/Modules#wiki-web-frameworks-full) , like restify, express, I think hapi was built for your needs. Its focus is on your business logic, and favours configuration for simple and fast deployment.
You can find the package in https://npmjs.org/package/hapi, and https://github.com/spumko/hapi
It looks very promising. There's a talk about the framework in https://www.youtube.com/watch?v=Recv7vR8ZlA where the main contributor talks about what makes an API framework tick.
It supports caching, validations, plug-ins and more (watch the video).