Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

API Features and Endpoints #13

Open
geekman-rohit opened this issue Jul 3, 2015 · 11 comments
Open

API Features and Endpoints #13

geekman-rohit opened this issue Jul 3, 2015 · 11 comments

Comments

@geekman-rohit
Copy link
Contributor

It has been decided not to use a database for now, instead all data is to be passed to server using HTTP GET. The UI wil also update the current url in window with the latest changes in data. This would make each theme state bookmarkable.

This is a general issue, also to discuss what features the API should support and the addresses for each
For example :

  1. Recieve JSON data for variables (compressed) and return compiled CSS file
  2. Recieve JSON data for variables (compressed) and return a zip file ( compiled CSS, source SCSS, a JSON file that can later be uploaded)

3. Upload JSON file (We agreed on doing this without upload, the ui will parse the json and update the theme)

@geekman-rohit
Copy link
Contributor Author

I propose we should have all apis not in root route but in "/api/"
Examples:

  1. /api/css?d=[THEME-DATA]
  2. /api/download?d=[THEME-DATA]

@geekman-rohit geekman-rohit changed the title API Endpoints API Features and Endpoints Jul 3, 2015
@jzaefferer
Copy link

Upload JSON file

What's the purpose of this?

@geekman-rohit
Copy link
Contributor Author

@jzaefferer our download zip will contain a json file that can later be uploaded to the site to get back to the theme. This will be beneficial in case we change api/other things in future.

@jzaefferer
Copy link

You've edited the original description to say "without upload", what will that look like? Use HTTP terms, please.

@sfrisk
Copy link

sfrisk commented Jul 20, 2015

I believe the decision between @geekman-rohit, @arschmitz, and myself last Tuesday was to paste json data into a textarea and processing the variable data via a form submit, allowing for more client side validation, rather than uploading a physical .json file via a file uploader to the server.

@jzaefferer
Copy link

So the endpoint would be a POST method expecting a application/json body?

@sfrisk
Copy link

sfrisk commented Jul 20, 2015

Yes.

@arschmitz
Copy link

@sfrisk I believe what we discussed was that it would not post at all and would just parse client side and update the approriate fields

@jzaefferer
Copy link

Okay. What about the [THEME-DATA] in the other two endpoints? Are those POST as well? Examples above imply GET with query string.

@sfrisk
Copy link

sfrisk commented Jul 20, 2015

Ah okay, for some reason I thought it was going through the server side code, but my IRC history didn't go back that far to double check. I stand corrected.

@geekman-rohit
Copy link
Contributor Author

It will be GET, the json data for variables will be encoded in a string (and probably compressed) and passed as shown in example, using GET. I added upload file option to consider any server side support to parse the JSON File (which will contain theme data which user can upload to recover the theme). @arschmitz , me and @sfrisk however agreed not to use any server side support at all and parse json in the browser, and rely on the usual api (or in browser method) used to update the theme.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants