Jump to content

Recommended Posts

Posted

I need to develop a RESTful API in ProcessWire.  While I haven't developed one before, I am fairly comfortable with the general idea.

There are separate PHP frameworks that specialize in this, as well as specific ProcessWire modules, however I want to do this purely with ProcessWire.  I haven't seen discussion on this, but my thinking is the necessary features are there to make this happen, which are:

Any thoughts on this or recommendations?

Posted

About URL hooks

Not sure it has change but once happened to me that I couldn't do optional segments, example:

/get-images/{page}/{field}/

Request wouldn't reach if I tried to get to:

/get-images/{page}/

Then I think the concept of middleware is not present? So say you want to block unauthenticated calls, check CSRF, etc, you'd have to make that check on every route hook.

Probably AppApi is still the way to go, feature wise? Project seems very alive!

Edit: Just reading AppApi actually uses path hooks to bootstrap its endpoints.

  • Like 1
Posted
6 hours ago, Jonathan Lahijani said:

I haven't seen discussion on this

There has been a lot of discussion here ? https://processwire.com/talk/topic/26792-headless-processwire-how-do-you-do-it/

4 hours ago, elabx said:

Not sure it has change but once happened to me that I couldn't do optional segments, example:

/get-images/{page}/{field}/

I think this should work:

/get-images(/{page})?(/{field})?/

? 

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...