repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

starfx / docs / posts
Eric Bower · 16 Aug 24

controllers.md

 1---
 2title: Controllers
 3description: How controllers work in starfx
 4---
 5
 6Why do we call this a micro-mvc framework? Well, our controllers are lighter
 7weight than traditional MVC frameworks.
 8
 9Controllers do not relate to pages, they most often relate to centralized pieces
10of business logic. This could be as simple as making a single API endpoint and
11caching the results or as complex as making multiple dependent API calls and
12combinatory logic.
13
14Not only do have a centralized place for handling complex business logic,
15fetching API data, and updating our FE global state, but we also have a robust
16middleware system similar to `express` or `koa`!
17
18In the following sections we will discuss how to create controllers and the
19different use cases for them inside `starfx`.