totaljs / flow

Flow
MIT License
538 stars 121 forks source link

How would you use servicemode? #99

Closed developedsoftware closed 1 year ago

developedsoftware commented 1 year ago

As I understand it, it allows you to include flow as part of a bigger app. But I cannot see any implementations of this for inspiration?

petersirka commented 1 year ago

The servicemode option is a special mode for the Total.js framework. It will run the app without an HTTP server. I didn't test this mode with the Flow, but the Flow uses our standard predefined starting script: https://github.com/totaljs/framework4/blob/master/helpers/index.js.

If you're looking for something special, please look at these repositories:

What is the service mode used for? Imagine that you need to create a service (not in Flow) that can do some DB operations or imports or provide some events without needing to publish its API. Service mode will run the app as usual, but without mentioning an HTTP server.

developedsoftware commented 1 year ago

Ah OK understand. If flow isn't started with a web server running would you essentially have to build your own UI and routers to interact with the application.

Am I right in assuming service mode just exposes the api ?

Apologies if I am missing some key concept here!

petersirka commented 1 year ago

Ah OK understand. If flow isn't started with a web server running would you essentially have to build your own UI and routers to interact with the application.

No because how do you want to build UI to the Flow if the web server is not started?

Am I right in assuming service mode just exposes the api ?

No, it doesn't expose the API. API is blocked/not started in service mode.

Apologies if I am missing some key concept here!

The service mode isn't meant for the service / REST API. It's deaf and blind.