I recently started to build Vue SPAs with ProcessWire as the backend, connected with a REST API. Thanks to code and the help of @LostKobrakai (How to use FastRoute with ProcessWire) and @clsource (REST-Helper) I got it up and running pretty quickly and now have put all of it in a site profile for others to use. It includes the REST API with routing for different endpoints, JWT Auth and a simple Vue SPA which shows the process of logging in a user (nevertheless, you don't have to use the Vue part
Thank you for the profile.
I'm trying to move client vue part to another domain. In order to do that, i had to make a few modifications:
public static function preflight()
header('Access-Control-Allow-Headers: Authorization, Content-Type');
$r->addGroup('/auth', function (\FastRoute\RouteCollector $r)
$r->addRoute('OPTIONS', '', Auth::class . '@preflight');