RestApi
RestApi copied to clipboard
Init fork v1 // Make the REST Api a little bit more Processwire'esque
Extended Install routine
- added api template
- added api fields
- add api route container
- added example route pages
Changes to routes.php
-
added method to grab pw created pages as routes
-
let the module scan for new api classes
-
changed file structure
@Luis85 Thanks for your input and your work on the module – it's really appreciated! However, I'm personally not sure if it is the most sensible approach to define the endpoints in ProcessWire itself:
- It's slower compared to just copy&paste a line in
Routes.php
- the routes are not going to be version controlled in git (which is my main pain point here)
- it's going to be a developer anyway, who implements the endpoint's logic. So I guess this person is probably comfortable to add the corresponding route aswell
I can't see any real upsides to this approach from my point of view. If I'm missing something here, I'd be happy if you could elaborate :)