###############################################################################

      *****************        Hey! Welcome to the Kwoosh Workshop
     *******************       -----------------------------------
    *******  *****  *****
   ********  ****  *******     This is where we talk about the things
  *********  ***  *********    we're working on.
 **********  **  ***********
***********     *************  Most things start as messy ideas before
 **********  **  ***********   they get polished into finished features.
  *********  ***  *********
   ********  ****  *******     This is a place for messy ideas.
    *******  *****  *****
     *******************       For the completed product see kwoosh.com
      *****************

###############################################################################
                

Accidentally created an API

Over the past few days I accidentally created an API for Kwoosh.

It started out by thinking about how a delete link should work, and ended up by cleaning up a lot of code and making things both simpler and more useful.

We probably won’t tout the API itself, but we will use it for the front end of Kwoosh and in theory a user could use it to create their own apps.

Once we decided to do a RESTFUL delete request, the easiest way to handle it was to create a method for each allowed HTTP method per view. This then soon grew to remove the non-RESTFUL endpoints we had and merge them into a REST friendly environment.

It then turns out that the rest of the work we have been doing to move to Vue.js, allows us to easily select just the response data to return. And with that we have an accidental JSON API.

—jw