"use strict";(self.webpackChunkdashy=self.webpackChunkdashy||[]).push([[800],{3905:function(e,t,n){n.d(t,{Zo:function(){return p},kt:function(){return h}});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),u=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=u(e.components);return r.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},c=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),c=u(n),h=a,k=c["".concat(s,".").concat(h)]||c[h]||d[h]||o;return n?r.createElement(k,i(i({ref:t},p),{},{components:n})):r.createElement(k,i({ref:t},p))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=c;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:a,i[1]=l;for(var u=2;u {\n event.respondWith(handleRequest(event.request))\n})\n\nasync function handleRequest(request) {\n return new Response('Hello World!', {\n headers: { 'content-type': 'text/plain' },\n })\n}\n")),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"For the code used for Dashy's cloud service, see ",(0,o.kt)("a",{parentName:"li",href:"https://gist.github.com/Lissy93/d19b43d50f30e02fa25f349cf5cb5ed8#file-index-js"},"here"))),(0,o.kt)("h4",{id:"commands"},"Commands"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"wrangler dev")," - To start the wrangler development server"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"wrangler publish")," - To publish to your cloudflare account (first run ",(0,o.kt)("inlineCode",{parentName:"li"},"wrangler login"),")")),(0,o.kt)("h3",{id:"api"},"API"),(0,o.kt)("p",null,"There are four endpoints, and to keep things simple, they all use the same base URL/ route."),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},(0,o.kt)("inlineCode",{parentName:"strong"},"GET"))," - Get config for a given user",(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"backupId")," - The ID of the desired encrypted object"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"subHash"),"\t- The latter half of the password hash, to verify ownership"))),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},(0,o.kt)("inlineCode",{parentName:"strong"},"POST"))," - Save a new config object, and returns ",(0,o.kt)("inlineCode",{parentName:"li"},"backupId"),(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"userData")," - The encrypted, compressed and stringified user config"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"subHash")," - The latter half of the password hash, to verify ownership"))),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},(0,o.kt)("inlineCode",{parentName:"strong"},"PUT"))," - Update an existing config object",(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"backupId")," - The ID of the object to update"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"subHash"),"\t- Part of the hash, to verify ownership of said object"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"userData")," - The new data to store"))),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("strong",{parentName:"li"},(0,o.kt)("inlineCode",{parentName:"strong"},"DELETE"))," - Delete a specified config object",(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"backupId")," - The ID of the object to be deleted"),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"subHash"),"\t- Part of the password hash, to verify ownership of the object")))),(0,o.kt)("p",null,"For more info, see the ",(0,o.kt)("a",{parentName:"p",href:"https://documenter.getpostman.com/view/2142819/TzXumzce"},"API Docs"),"."),(0,o.kt)("p",null,"If you are using Postman, you may find this pre-made ",(0,o.kt)("a",{parentName:"p",href:"https://www.getpostman.com/collections/58f79ddb150223f67b35"},"collection")," helpful in getting things setup."))}c.isMDXComponent=!0}}]);